Salut WhiteDwarf
En fait, il te suffit d'appeler l'API du système :
Met cette déclaration dans la partie Déclaration (la bien nommée)
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 uFlags As Long) As Long
' Constantes de SetWindowPos :
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOACTIVATE = &H10
Puis, créé cette Sub :
Public Sub SetTop(Form As Form, ByVal Topmost As Boolean)
Dim hWndInsertAfter As Long
If Topmost Then
hWndInsertAfter = HWND_TOPMOST
Else
hWndInsertAfter = HWND_NOTOPMOST
End If
SetWindowPos Form.hwnd, hWndInsertAfter, 0, 0, 0, 0, _
SWP_NOSIZE Or SWP_NOMOVE Or SWP_NOACTIVATE
End Sub
Pour t'en servir, simplement :
Call SetTop (MaForme, True) ' ou False
Vala
Jack