finished resizing event

mskeel

Well-known member
Joined
Oct 30, 2003
Messages
913
Location
Virginia, USA
Is there a way to know when the user is finished resizing a dialog? By this I mean then click on an edge or the corner, resize the dialog, and then release the mouse indicating they are finished resizing.

Mouse down does not fire becuase the click is technically no longer in the form (console.writeline the event). resize, resizing, and paint all fire in triplets for each movement of the form. If you finish moving and stay clicked, no more events fire, and when you relase no new events fire that I know of.

Is there a way to know when the resizing is finished? A good example of this would be power point in XP Pro. if you have a slide in the slide viewer on the left and you resize powerpoint, the resolution of the slide preview wont change until after you are finished resizing...

What event is thrown? How can I know when resizing is complete?
 
I suggest a crystalball, no, not really... how about timer starts when u resize and it checks if the resizing is done by checking if the size variables has changed in a specific time margin? if not = timer holds and......................what ever you want.
 
you can use the Windows Messages that are sent to the form to determine the current state of the Form (whether it is getting resized or not..). just add these lines to your Form:

Code:
Protected Overrides Sub WndProc(ByRef m As Message)

        If m.Msg = WM_SizeMessages.WM_Sizing Then
            Me.Text = "Resizing the Form..."
        ElseIf m.Msg = WM_SizeMessages.WM_ExitSizeMove Then
            Me.Text = "Resize Done"
        End If

        MyBase.WndProc(m)
End Sub

Private Enum WM_SizeMessages
        WM_Sizing = &H214
        WM_ExitSizeMove = &H232
End Enum

Hope this helps!

Andreas
 


Write your reply...
Back
Top