Re: Sizechanged event question...
Addendum:
\\\
Private m_Image As Image
Private m_Redraw As Boolean = True
Private Sub Form1_Load( _
ByVal sender As Object, _
ByVal e As EventArgs _
) Handles MyBase.Load
m_Image = Image.FromFile( "C:\WINDOWS\Ang ler.bmp")
End Sub
Protected Overrides Sub WndProc( _
ByRef m As Message _
)
Const WM_ENTERSIZEMOV E As Int32 = &H231
Const WM_EXITSIZEMOVE As Int32 = &H232
Select Case m.Msg
Case WM_ENTERSIZEMOV E
m_Redraw = False
Case WM_EXITSIZEMOVE
m_Redraw = True
Me.Panel1.Inval idate()
End Select
MyBase.WndProc( m)
End Sub
Private Sub Panel1_Paint( _
ByVal sender As Object, _
ByVal e As PaintEventArgs _
) Handles Panel1.Paint
If m_Redraw Then
e.Graphics.Draw Image( _
m_Image, _
0, 0, _
Me.Panel1.Clien tSize.Width, Me.Panel1.Clien tSize.Height _
)
End If
End Sub
///
However, this solution would prevent the panel from redrawing if the window
is dragged by the mouse.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Addendum:
\\\
Private m_Image As Image
Private m_Redraw As Boolean = True
Private Sub Form1_Load( _
ByVal sender As Object, _
ByVal e As EventArgs _
) Handles MyBase.Load
m_Image = Image.FromFile( "C:\WINDOWS\Ang ler.bmp")
End Sub
Protected Overrides Sub WndProc( _
ByRef m As Message _
)
Const WM_ENTERSIZEMOV E As Int32 = &H231
Const WM_EXITSIZEMOVE As Int32 = &H232
Select Case m.Msg
Case WM_ENTERSIZEMOV E
m_Redraw = False
Case WM_EXITSIZEMOVE
m_Redraw = True
Me.Panel1.Inval idate()
End Select
MyBase.WndProc( m)
End Sub
Private Sub Panel1_Paint( _
ByVal sender As Object, _
ByVal e As PaintEventArgs _
) Handles Panel1.Paint
If m_Redraw Then
e.Graphics.Draw Image( _
m_Image, _
0, 0, _
Me.Panel1.Clien tSize.Width, Me.Panel1.Clien tSize.Height _
)
End If
End Sub
///
However, this solution would prevent the panel from redrawing if the window
is dragged by the mouse.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Comment