Option Explicit
Declare Sub SetWindowPos Lib "user32.dll" (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)
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Const SWP_NOACTIVATE = &H10
Const SWP_SHOWWINDOW = &H40
Public Sub SiempreVisible(Formulario As Form, Estado As Boolean)
If Estado Then
SetWindowPos Formulario.hWnd, HWND_TOPMOST, Formulario.Left / 15, _
Formulario.Top / 15, Formulario.Width / 15, _
Formulario.Height / 15, SWP_NOACTIVATE Or SWP_SHOWWINDOW
Else
SetWindowPos Formulario.hWnd, HWND_NOTOPMOST, Formulario.Left / 15, _
Formulario.Top / 15, Formulario.Width / 15, _
Formulario.Height / 15, SWP_NOACTIVATE Or SWP_SHOWWINDOW
End If '
End Sub
' SiempreVisible me, true para hacer siempre visible
' SiempreVisible me, false para que no sea siempre visible