Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Savoir quand un pictureBox devient invisible

3 réponses
Avatar
Fournier Raymond
Bonjour a tous,
J'ai déjà posé une question similaire mais peut-être je me suis mal
exprimer. Est-il est possible de savoir quand un PictureBox devient
invisible. Ceci est dans le but de décharger les contrôles a l'intérieure.

Merci Raymond Fournier

3 réponses

Avatar
le_troll
Salut,

Est-ce que ça, ça ne marcherait pas ?

If PictureBox1.Visible = False

--
Merci, @+, bye, Joe
troll75 AROBASE iFrance POINT com
------------------------------------------
Ce message est plein de virus "certifiés"
Le_Troll, éleveur then de Trolls depuis César, qui disait:
Avec une hache, celui qui tient le manche a toujours raison !
------------------------------------------


"Fournier Raymond" <duracelle(Enlever-ceci)@sympatico.ca> a écrit dans le
message de news:
Bonjour a tous,
J'ai déjà posé une question similaire mais peut-être je me suis mal
exprimer. Est-il est possible de savoir quand un PictureBox devient
invisible. Ceci est dans le but de décharger les contrôles a l'intérieure.

Merci Raymond Fournier



Avatar
Fournier Raymond
"le_troll" wrote in
news:#b2r$:

Salut,

Est-ce que ça, ça ne marcherait pas ?

If PictureBox1.Visible = False

--
Merci, @+, bye, Joe
troll75 AROBASE iFrance POINT com
------------------------------------------
Ce message est plein de virus "certifiés"
Le_Troll, éleveur then de Trolls depuis César, qui disait:
Avec une hache, celui qui tient le manche a toujours raison !
------------------------------------------


"Fournier Raymond" <duracelle(Enlever-ceci)@sympatico.ca> a écrit dans
le message de news:

Bonjour a tous,
J'ai déjà posé une question similaire mais peut-être je me suis
mal
exprimer. Est-il est possible de savoir quand un PictureBox devient
invisible. Ceci est dans le but de décharger les contrôles a
l'intérieure.

Merci Raymond Fournier








Bien sur pourquoi faire compliquer quand sa peux être facile

Merci Raymond Fournier
Avatar
Zoury
Salut Raymond! :O)

Utilise un hook..

Ex :
'***
' Form1
' 1 PictureBox
' 1 CommandButton
Option Explicit

Private Sub Command1_Click()
Picture1.Visible = Not Picture1.Visible
End Sub

Private Sub Form_Load()
Me.Caption = "Simulateur d'événement OnHide/OnShow"
Command1.Caption = "Cliquer ici"
Call Hook(Picture1.hWnd)
End Sub

Private Sub Form_Unload(Cancel As Integer)
Call Unhook
End Sub
'***
'***
' Module1
Option Explicit

Private Type CWPSTRUCT
lParam As Long
wParam As Long
message As Long
hWnd As Long
End Type

Private Declare Function CallNextHookEx _
Lib "user32" _
( _
ByVal hHook As Long, _
ByVal nCode As Long, _
ByVal wParam As Long, _
ByRef lParam As CWPSTRUCT _
) As Long

Private Declare Function SetWindowsHookEx _
Lib "user32" _
Alias "SetWindowsHookExA" _
( _
ByVal idHook As Long, _
ByVal lpfn As Long, _
ByVal hmod As Long, _
ByVal dwThreadId As Long _
) As Long

Private Declare Function UnhookWindowsHookEx _
Lib "user32" _
( _
ByVal hHook As Long _
) As Long

Private Const WH_CALLWNDPROC As Long = &H4
Private Const WM_SHOWWINDOW As Long = &H18
Private m_hWinHook As Long
Private m_hWndWatched As Long

Public Sub Hook(ByRef hWndWatched As Long)
m_hWndWatched = hWndWatched
m_hWinHook = SetWindowsHookEx(WH_CALLWNDPROC, AddressOf CallWndProc, 0&,
App.ThreadID)
End Sub

Public Sub Unhook()
If (m_hWinHook <> 0&) Then
Call UnhookWindowsHookEx(m_hWinHook)
m_hWinHook = 0&
m_hWndWatched = 0&
End If
End Sub

Public Function CallWndProc(ByVal nCode As Long, ByVal wParam As Long, ByRef
lParam As CWPSTRUCT) As Long
If (lParam.hWnd = m_hWndWatched) Then
If (lParam.message = WM_SHOWWINDOW) Then
If (lParam.wParam = 1) Then
' visible
Debug.Print "visible"
Else
' invisible
Debug.Print "invisible"
End If
End If
End If
CallWndProc = CallNextHookEx(m_hWinHook, nCode, wParam, lParam)
End Function
'***

--
Cordialement
Yanick Lefebvre - MVP pour Visual Basic
Le français se refait une beauté, parlons en :
http://www.orthographe-recommandee.info/