tilføj : 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
Public Const HWND_TOPMOST = -1 Public Const SWP_NOMOVE = &H2 Public Const SWP_NOSIZE = &H1 Public Const SWP_NOZORDER = &H8
\'------------------------------------------ Module1 ------------------------------------------ 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
Function AlwaysOnTop(Form As Form, Optional TopMost As Boolean = True) AlwaysOnTop = SetWindowPos(Form.hWnd, IIf(TopMost, HWND_TOPMOST, HWND_NOTOPMOST), 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE) End Function \'------------------------------------------ Module1 ------------------------------------------
\'-------------------------------- Form1 -------------------------------- Private Sub Check1_Click() If Check1.Value = 1 Then AlwaysOnTop Me, True If Check1.Value = 0 Then AlwaysOnTop Me, False End Sub \'-------------------------------- Form1 --------------------------------
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.