Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Load a form and have it always visible on front
Message
 
À
16/07/2001 09:53:37
Information générale
Forum:
Visual Basic
Catégorie:
VBScript
Divers
Thread ID:
00530974
Message ID:
00531097
Vues:
25
>I want to load a form in full screen and a small form that i want to be always visible untill i unload it and also while i m accessing the full screen form
>(i don't want to use MDI forms).
>all ideas are welcomed
>thx

Try this:
Place in MODULE

Global Const SWP_NOMOVE = 2Global Const SWP_NOSIZE = 1
Global Const HWND_TOPMOST = -1Global Const HWND_NOTOPMOST = -2
Global Const FLOAT = 1, SINK = 0
Public Declare Sub 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)

This is a sub within the module

Sub FloatWindow(X As Integer, action As Integer)

Dim wFlags As Integer, result As Integer
wFlags = SWP_NOMOVE Or SWP_NOSIZE

If action <> 0 Then
' Float
Call SetWindowPos(X, HWND_TOPMOST, 0, 0, 0, 0, wFlags)
Else
' Sink
Call SetWindowPos(X, HWND_NOTOPMOST, 0, 0, 0, 0, wFlags)
End If

End Sub

Code to use -->

'Float code

Dim f as integer
f = Screen.ActiveForm.hWndCall
FloatWindow(f, FLOAT)

'sink code

Dim f as integer
f = Screen.ActiveForm.hWndCall FloatWindow(f, SINK)to sink.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform