Ver Mensaje Individual
  #3 (permalink)  
Antiguo 10/03/2008, 11:27
MartinZan
 
Fecha de Ingreso: marzo-2008
Ubicación: Mendoza
Mensajes: 2
Antigüedad: 16 años, 2 meses
Puntos: 0
Re: Mostrar siempre un formulario

Yo utilizaria la funcion AlwaisOnTop (siempre arriba)

Codigo para el form frmCargo:

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 HWND_NOTOPMOST = -2
Public Const SWP_NOSIZE = &H1
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOACTIVATE = &H10
Public Const SWP_SHOWWINDOW = &H40

Public Sub AlwaisOnTop(f As Form, estado As Boolean)
Dim wflags As Long
Dim ret As Long
'para que no cambie el tamaño ni la posición
wflags = SWP_NOMOVE Or SWP_NOSIZE
If estado Then
ret = SetWindowPos(f.hwnd, HWND_TOPMOST, 0, 0, 0, 0, wflags)
Else
ret = SetWindowPos(f.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, wflags)
End If
End Sub

Private Sub Form_Load()
AlwaisOnTop Me, True
End Sub