Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Want to maximize a window all the time

Status
Not open for further replies.

acjeff

Programmer
Aug 10, 2004
148
US
In a VB6 application, I set a form's MaxButton property to be false and its default window state to be maximumized. However, in running time, when I double-click the blue menu bar, the form restores from maximum to normal state. Then I double-click again, it does not go back to be maximumized.

1. How can I go back to miximum window by double-click again?

2. How can I not allow the user to restore the window by double-clicking at the first time. Or, maybe, just disable the double-click event?
 
You could just set the state on the form load and the form resize. e.g.

Code:
Private Sub Form_Load()
Form1.WindowState = vbMaximized
End Sub

Private Sub Form_Resize()
Form1.WindowState = vbMaximized
End Sub

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Basically it works. However, it looks like bouncing on the screen because you can see the form size restoring and then maximizing. I want to do like no response at all. Any other idea?
 
No not really!

Without delving into some fairly complex API's, grabbing the double-click event on a window and neutralising it, I can't think of any other way.

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top