|
|
|
|
|
Dicas
|
|
Visual Basic (Forms/MDI)
|
|
|
Título da Dica: Formulário sempre OnTop
|
|
|
|
Postada em 14/7/2003 por D4N!3L
Daniel_D@mail.pt
Que tal meter uma janela sempre no topo??? sempre da jeito para as nossas aplicações...
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
Private Const SWP_NOMOVE = 2 Private Const SWP_NOSIZE = 1 Private Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE Private Const HWND_TOPMOST = -1 Private Const HWND_NOTOPMOST = -2
Sub NoTopoSim(WinHandle As Long) 'No topo lResult = SetWindowPos(WinHandle, HWND_TOPMOST, 0, 0, 0, 0, FLAGS) End Sub
Sub NoTopoNão(WinHandle As Long) 'Tirar do Topo lResult = SetWindowPos(WinHandle, HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS) End Sub
Private Sub CmdTirardoTopo_Click() NoTopoNão Me.hwnd End Sub
Private Sub CmdTopo_Click() NoTopoSim Me.hwnd End Sub
|
|
|
|
|