Capturing If user pressed max, min or normalize button on form 
Author Message
 Capturing If user pressed max, min or normalize button on form

Try...
'========
Private Sub Form_Resize()
   Select Case Me.WindowState
      Case vbNormal
         Debug.Print "This form is Normal"
      Case vbMinimized
         Debug.Print "This form is Minimized"
      Case vbMaximized
         Debug.Print "This form is Maximized"
   End Select
End Sub

'========


Quote:
> I'm trying to find out if it is possible to capture what
> button the user pressed on a vb form.  I'm trying to
> specifically determine if the normal window button is
> pressed so that I can intercept and size form.



Wed, 10 Dec 2003 00:54:08 GMT  
 Capturing If user pressed max, min or normalize button on form

On bar that displays the object name and where you can choose a event for
the object, the form object has a resize event. You can write code here to
memeorize the procedure, or edit it like this:

'------------------------------------
Private Sub Form_Resize()

if me.windowstate = vbNormal then
    me.left = 500
    me.top = 300
elseIf me.windowstate = VbMinimize then
    me.left = 50
    me.top = 99
else
    me.left =    0
    me.top = 0
end if

End sub
'-----------------------------------


Quote:
> I'm trying to find out if it is possible to capture what
> button the user pressed on a vb form.  I'm trying to
> specifically determine if the normal window button is
> pressed so that I can intercept and size form.



Wed, 10 Dec 2003 19:31:32 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. MDI child form, Min and Max buttons

2. MDI Form Min/Max Button

3. Disabling Min and Max buttons on MDI Form

4. Disabling Min, Max, and Close buttons on MDI form

5. Parent MDI form without Min and Max Buttons?

6. MDI form without title bar, control box, max/min buttons

7. How to hide the min/max buttons in a MDI form

8. Icon on a Form without max/min buttons

9. Capture the user pressing minimize button

10. Min, Max Buttons

11. min/max button ?

12. Q: Overriding min,max,rstr Buttons

 

 
Powered by phpBB® Forum Software