AlwaysOnTop - ocx file
Hej exp'erjeg sidder roder lidt med visual basic og har søgt lidt her på exp.dk om "Always On Top ocx" men har ikke kunne finde noget.
Så vil høre om der kan hjælpe mig, med at fortælle hvad jeg skal gøre for at min "ActiveX Control" til at virke..
-------------------------------------------------------
Option Explicit
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
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
Public Function AlwaysOnTop(TheForm, Optional TopMost As Boolean = True)
Const HWND_TOPMOST = -&H1
Const HWND_NOTOPMOST = -&H2
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
AlwaysOnTop = SetWindowPos(TheForm.hWnd, IIf(TopMost, HWND_TOPMOST, HWND_NOTOPMOST), 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE)
End Function
'(Module eller Form)
Private Sub Check1_Click()
If Check1.Value = 1 Then AlwaysOnTop Me, True
If Check1.Value = 0 Then AlwaysOnTop Me, False
End Sub
det viker ikke i "ActiveX Control"
håber der er en der kan hjælpe mig
