dekzorro 0 Report post Posted June 27, 2004 helo semua... camna aku nak nak setkan form VB aku tuh papar sebelah kanan, kiri, atas, bawah pada skrin.satu lagi... camna coding untuk setkan form tuh display on top aje?tq Quote Share this post Link to post Share on other sites
aRmsTer 0 Report post Posted June 28, 2004 1. pakai ni: form_name.top = value // 0 utk top form_name.left = value // 0 utk bhgn kiri sekali //utk center screen Form_name.Left = (Screen.Width - F.Width) / 2 form_name.Top = (Screen.Height - F.Height) / 2 2. pakai statement vbmodal form_name.show vbmodalsekian terima kasih Quote Share this post Link to post Share on other sites
dekzorro 0 Report post Posted June 29, 2004 tq aRmsTer!!! Quote Share this post Link to post Share on other sites
dekzorro 0 Report post Posted June 30, 2004 aRmsTer...aku dah try dah coding yg ko bagi tuh..utk align top ngan center screen tu ok..jadik.tapi yang nak set on top tu tak jadi la.aku guna check box, coding yg aku buat camni:if checkbox.enable = true then frmHelo.show vbModalend ifcara aku tuh salah ke? Quote Share this post Link to post Share on other sites
Chip 0 Report post Posted July 4, 2004 kebetulan laks.......tapi guna API.....Option ExplicitPrivate Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As LongConst HWND_TOPMOST = -1Const SWP_SHOWWINDOW = &H40Const HWND_NOTOPMOST = -2Private Sub Check1_Click() Dim Nil, Tinggi, Lebar, Atas, Kiri As Long Tinggi = 300 Lebar = 300 Atas = 12 Kiri = 16 If Check1.Value = 1 Then Nil = SetWindowPos(Me.hwnd, HWND_TOPMOST, Kiri, Atas, Lebar, _ Tinggi, SWP_SHOWWINDOW) ElseIf Check1.Value = 0 Then Nil = SetWindowPos(Me.hwnd, HWND_NOTOPMOST, Kiri, Atas, Lebar,_ Tinggi, SWP_SHOWWINDOW) End If End Sub Quote Share this post Link to post Share on other sites
dekzorro 0 Report post Posted July 7, 2004 thak Chip utk coding ko tuh. aku sebonarnye tak paham la cara guna API tuh..bole ko ngajar aku skit??? Quote Share this post Link to post Share on other sites
aRmsTer 0 Report post Posted July 7, 2004 if checkbox.enable = true then frmHelo.show vbModalend ifcara aku tuh salah ke? salah tu..contoh aku ada 2 form, Form1(main form) & form2(form utk yg stay on top)kat Form1 ada 2 component, checkbox Check1 & button Command1jadik aku buat coding bila klik kat button... kalau Check1 tu di tick-kan, Form2 akan kuar n stay on topPrivate Sub Command1_Click() If Check1.Value = vbChecked Then Form2.Show vbModal End If End Suberr... ko cuma nak dia jadik modal form kat program tuh je kan? bukan semua windows program kan?p/s: sori aku lambat reply... aku xperasan ko tanya coding Quote Share this post Link to post Share on other sites
Chip 0 Report post Posted July 7, 2004 dekzorro aku pun Xreti... aku bukanya ada kelulusan dalam bidang ni ... aku belajo pun guna buku je... kalau apa yang aku tau tu boleh le aku tunjukkan... Buah cempedak di luar pagar,Ambil galah tolong jolokkan,Saya budak baru nak belajar,Kalau salah tolong betulkan, Quote Share this post Link to post Share on other sites
cade 0 Report post Posted July 7, 2004 camna kalo nak disable kan user dari double klik kat title window, aku taknak dia resize ke size development, aku nak dia fit2 kat user screen on start up Quote Share this post Link to post Share on other sites
dekzorro 0 Report post Posted July 8, 2004 salah tu..contoh aku ada 2 form, Form1(main form) & form2(form utk yg stay on top)kat Form1 ada 2 component, checkbox Check1 & button Command1jadik aku buat coding bila klik kat button... kalau Check1 tu di tick-kan, Form2 akan kuar n stay on topPrivate Sub Command1_Click() If Check1.Value = vbChecked Then Form2.Show vbModal End If End Suberr... ko cuma nak dia jadik modal form kat program tuh je kan? bukan semua windows program kan?p/s: sori aku lambat reply... aku xperasan ko tanya coding err... ko cuma nak dia jadik modal form kat program tuh je kan? bukan semua windows program kan?aku nak jadikan utk semua program lerr... bukak MS Office pung, form tuh tetap ada kat top.cam tu ler kirenyer... Quote Share this post Link to post Share on other sites
dekzorro 0 Report post Posted July 8, 2004 dekzorro aku pun Xreti... aku bukanya ada kelulusan dalam bidang ni ... aku belajo pun guna buku je... kalau apa yang aku tau tu boleh le aku tunjukkan... Buah cempedak di luar pagar,Ambil galah tolong jolokkan,Saya budak baru nak belajar,Kalau salah tolong betulkan, dekzorro aku pun Xreti... aku bukanya ada kelulusan dalam bidang ni ... aku belajo pun guna buku je... kalau apa yang aku tau tu boleh le aku tunjukkan... aku lagiiiiiii la budak baru belajaq... kat umah aku takde internet..tu yg susah skit nak cari info... Quote Share this post Link to post Share on other sites
dekzorro 0 Report post Posted July 8, 2004 chip... coding yg ko pot tuh jadik..tapi bila aku klik checkbox, saiz form tukar la..aku takdapat lagi cara nak perbetul tuh. Quote Share this post Link to post Share on other sites
Chip 0 Report post Posted July 9, 2004 dekzorro.....sebelum tu.. aku nak bagi tau ko.... aku ni sekolah sampai ting 3 je... jadi bab-bab math ni aku bukan reti sangat.... so kalau tak jadik tu ....... paham-paham je leee...ok..... aku ada buat penambahan cikit kat code tu......'--------------------------------- Option Explicit Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Const HWND_TOPMOST = -1 Const SWP_SHOWWINDOW = &H40 Const HWND_NOTOPMOST = -2 '------------------------------ ' bile klik '------------------------------ Private Sub Check1_Click() Dim Nil, Tinggi, Lebar, Atas, Kiri As Long Lebar = Me.Width / Screen.TwipsPerPixelX Tinggi = Me.Height / Screen.TwipsPerPixelY Kiri = ((Screen.Width - Me.Width) / 2) / Screen.TwipsPerPixelX Atas = ((Screen.Height - Me.Height) / 2) / Screen.TwipsPerPixelY If Check1.Value = 1 Then Nil = SetWindowPos(Me.hwnd, HWND_TOPMOST, Kiri, Atas, Lebar, Tinggi, SWP_SHOWWINDOW) ElseIf Check1.Value = 0 Then Nil = SetWindowPos(Me.hwnd, HWND_NOTOPMOST, Kiri, Atas, Lebar, Tinggi, SWP_SHOWWINDOW) End If End Sub '--------------------------- 'untuk center form '--------------------------- Private Sub Form_Load() Move Screen.Width / 2 - Width / 2, Screen.Height / 2 - Height / 2 End Sub Quote Share this post Link to post Share on other sites
Chip 0 Report post Posted July 10, 2004 ok.....mari kite tengok perubahan ke dua lak dengan function yang sama .....let go.....'--------------------------------- Option Explicit Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Const HWND_TOPMOST = -1 Const HWND_NOTOPMOST = -2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOMOVE = &H2 Private Const TOPMOST_FLAGS = SWP_NOMOVE Or SWP_NOSIZE '------------------------------ 'bile klik '----------------------------- Private Sub Check1_Click() If Check1.Value Then Call Sentiasa_kat_Atas(Me, True) Else Call Sentiasa_kat_Atas(Me, False) End If End Sub '-------------------------------- 'bile form load ( center form ) '--------------------------------- Private Sub Form_Load() Move Screen.Width / 2 - Width / 2, Screen.Height / 2 - Height / 2 End Sub '----------------------- ' ? terjadi '----------------------- Public Sub Sentiasa_kat_Atas(Form As Form, Kedudukan As Boolean) If Kedudukan = True Then SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS Else SetWindowPos Me.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS End If End Sub '------------------ 'selamat belajooo..... '------------------ Quote Share this post Link to post Share on other sites
dekzorro 0 Report post Posted July 13, 2004 aku ni sekolah sampai ting 3 je... ala...ko ting. 3 pung bole buat coding...aku nih sampai PhD pung tak bole² lagi.tima kasih bebanyak.caman lak kalu aku nak disable kan fungsi close program yg ada pd form tuh (mcm huruf X tuh). aku nengok ada form yg boleh disable kan function tuh. Quote Share this post Link to post Share on other sites