Form OnTop pada VB
June 5, 2008 at 4:10 pm | Posted in VB 6.0 | 1 Comment’1. buat modul dengan nama mdlOnTop
‘ketik pada modul
‘— begin —
Option Explicit
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Const SWP_NOMOVE = &H2
Const SWP_NOSIZE = &H1
Const SWP_NOACTIVATE = &H10
Const SWP_SHOWWINDOW = &H40
Const TOPMOST_FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Private Declare Function SetWindowPos Lib “user32″ (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, y, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Sub MakeOnTop(Handle As Long, status As Boolean)
If status = True Then
SetWindowPos Handle, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS
Else
SetWindowPos Handle, HWND_NOTOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS
End If
End Sub
‘— end of modul —
’2. Buat code pada form
‘ketik pada kode form
‘buat 2 buah button
‘— begin —
private sub commandOntop_click()
makeOntop me.hwnd, true
end sub
private sub commandOffTop()
makeontop me.hwnd, false
end sub
‘— end of code —
Semoga bermanfaat
1 Comment »
RSS feed for comments on this post. TrackBack URI
Leave a Reply
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.


[...] Referensi : http://kohimaru.wordpress.com/2008/06/05/form-ontop-pada-vb/#more-84 [...]
Pingback by Membuat Modul OnTop dengan VB 6.0 « Share your VB Project— February 6, 2009 #