|
-
Nov 21st, 2000, 01:10 PM
#1
Thread Starter
New Member
Under Form_Resize, how do I make it so that a window 500px wide by 200px high be the smallest size the window could be?
So the user couldn't resize it any smaller.. but can be bigger.
Thanks.
-
Nov 21st, 2000, 01:11 PM
#2
Do you use twip or pixel measurement for your form?
If you are using twips (the default) you could do something like:
Code:
Private Sub Form_Resize()
If Me.Width / Screen.TwipsPerPixelX < 500 Then
Me.Width = Screen.TwipsPerPixelX * 500
End If
If Me.Height / Screen.TwipsPerPixelY < 200 Then
Me.Height = Screen.TwipsPerPixelY * 200
End If
End Sub
Paul
[Edited by PWNettle on 11-21-2000 at 04:13 PM]
-
Nov 21st, 2000, 01:13 PM
#3
Thread Starter
New Member
-
Nov 21st, 2000, 01:15 PM
#4
If you're using pixel it would be a little less involved:
Code:
Private Sub Form_Resize()
If Me.Width < 500 Then
Me.Width = 500
End If
If Me.Height < 200 Then
Me.Height = 200
End If
End Sub
Paul
[Edited by PWNettle on 11-21-2000 at 04:13 PM]
-
Nov 21st, 2000, 01:23 PM
#5
Thread Starter
New Member
Hmm.. it isn't working 
I have a tabbed thing covering the whole form also..
-
Nov 21st, 2000, 02:09 PM
#6
Unless you have some kind of bizarre 3rd party tab control it shouldn't affect your form resizing.
If you're wanting to do this with pixels then check the ScaleMode property of your form and make sure it's set to '3 - Pixel' instead of the default setting of '1 - Twip'. If it's on Twips and you used the values of 500x200 in the resize event the form would have to get really tiny before the code would ever kick in.
Paul
[Edited by PWNettle on 11-21-2000 at 04:13 PM]
-
Nov 21st, 2000, 04:11 PM
#7
Code:
Private Sub Form_Resize()
If Width < 500 * 15 Then
Width = 500 * 15
End If
If Height < 300 * 15 Then
Height = 300 * 15
End If
End Sub
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
|