|
-
June 26th, 2001, 05:13 PM
#1
Form is MAXIMUM size ???
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!
-
June 26th, 2001, 06:51 PM
#2
Re: Form is MAXIMUM size ???
Check the WindowState property of the form.
-
June 26th, 2001, 07:07 PM
#3
Re: Form is MAXIMUM size ???
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
Andy Tower
-
June 27th, 2001, 07:22 AM
#4
Re: Form is MAXIMUM size ???
>>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.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
June 27th, 2001, 07:24 AM
#5
Re: Playing with resolution
You may find this interesting:
http://codeguru.earthweb.com/cgi-bin...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.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|