Protected Const WM_SIZING As Int32 = &H214
Protected Const WM_ENTERSIZEMOVE As Int32 = &H231
Protected Const WM_EXITSIZEMOVE As Int32 = &H232
Protected Const WM_SYSCOMMAND As Int32 = &H112
Protected Const SC_SIZE As Int32 = &HF000
'If you Inherit from this form then you'll be able to use these events
'without seeing the code, otherwise these events are not necessary.
Public Event BeginResize As EventHandler
Public Event EndResize As EventHandler
Protected Overridable Sub OnBeginResize(ByVal e As EventArgs)
RaiseEvent BeginResize(Me, e)
'Disable stuff here
End Sub
Protected Overridable Sub OnEndResize(ByVal e As EventArgs)
RaiseEvent EndResize(Me, e)
'Re-enable stuff here
End Sub
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Static SizeMode As Boolean = False
Select Case m.Msg
Case WM_SIZING
'Already have a Resize Method
Case WM_SYSCOMMAND
SizeMode = ((m.WParam.ToInt32 And &HFFF0) = SC_SIZE)
Case WM_ENTERSIZEMOVE
If SizeMode Then
OnBeginResize(EventArgs.Empty)
End If
Case WM_EXITSIZEMOVE
If SizeMode Then
OnEndResize(EventArgs.Empty)
End If
Case Else
End Select
MyBase.WndProc(m)
End Sub
--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Matt Burland" <wjousts@[nospam]hotmail.com> wrote in message
news:emS5zkfb...@TK2MSFTNGP09.phx.gbl...
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.719 / Virus Database: 475 - Release Date: 12/07/2004