John Reynolds
June 26th, 2001, 05:13 PM
Has the min/max/close buttons in top-right corner, but form ALWAYS max. (?) Is their a property I'm not seeing? I want it to be smaller when it opens.
Thanks for any assistance!
Thanks for any assistance!
|
Click to See Complete Forum and Search --> : Form is MAXIMUM size ??? John Reynolds June 26th, 2001, 05:13 PM Has the min/max/close buttons in top-right corner, but form ALWAYS max. (?) Is their a property I'm not seeing? I want it to be smaller when it opens. Thanks for any assistance! shree June 26th, 2001, 06:51 PM Check the WindowState property of the form. Tower June 26th, 2001, 07:07 PM In design time set form properties WindowState as Maximized After this insert this code private Sub Form_Resize() If Not Form1.WindowState = vbMaximized then Form1.WindowState = vbMaximized End Sub Cimperiali June 27th, 2001, 07:22 AM >>I want it to be smaller when it opens. after the loading of form, and before it is being showed, resize event for the form is called. You can put code in load event or in resize event depending if you want it executed once (on load) or each time it is resized. If you want it smaller on openig, you can code in load event or set the appropiate width and height in design mode. You will have to play with the screen.width and height to find out how many pixel you can draw. Ie: here some code you can play with option Explicit private Sub Form_DblClick() Call Form_Load End Sub private Sub Form_Load() Dim maxWidth as Single Dim maxHeight as Single 'save previous value maxWidth = me.Width maxHeight = me.Height 'set the state to normal, or you will not 'be able to move or resize me.WindowState = vbNormal 'restore previous dimensions even if 'diffrent from the ones it had last time 'it was "normal" me.Width = maxWidth me.Height = maxHeight 'take screen dimensions maxWidth = Screen.Width maxHeight = Screen.Height 'now check for dimensions If me.Height >= maxHeight - 1000 then me.Height = maxHeight * 0.75 End If If me.Width >= maxWidth - 1000 then me.Width = maxWidth * 0.75 End If End Sub Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus. Cimperiali June 27th, 2001, 07:24 AM You may find this interesting: http://codeguru.earthweb.com/cgi-bin/bbs/wt/showpost.pl?Board=vb&Number=55191&page=0&view=collapsed&sb=5 Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus. codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |