-
Ok.. i have seen a lot of controls that can do what i'm about to explain, but i dont really like controls because they are a pain in the azz to distribute.
Anywayz... How can i make it so my form can be resized no smaller than lets say... 1000x1000twips and no bigger than 10000x10000twips? or make it so there is no "max" size limit.
Thanx a lot!
-
How about this.
Try this in a new form:
Code:
Option Explicit
Dim MinHgt%, MinWdt%, MaxHgt%, MaxWdt%
Private Sub Form_Load()
MinHgt = 1000
MinWdt = 1000
MaxHgt = 10000
MaxWdt = 10000
End Sub
Private Sub Form_Resize()
If Form1.Height < MinHgt Then Form1.Height = MinHgt
If Form1.Height > MaxHgt Then Form1.Height = MaxHgt 'Remove for no MaxHeight
If Form1.Width < MinWdt Then Form1.Width = MinWdt
If Form1.Width > MaxWdt Then Form1.Width = MaxWdt 'Remove for no MaxWidth
End Sub
Saludos...;)
-
Thank you so much.. but i already knew how to do that.. have u ever tried it?? once the form gets past the "small" size it flickers between sizes.. that vb code sux.. i was hoping for sum API calls.. and i do know that they exsist.
Please help!!
-
Don't Happend to me¿?
I'm sorry that didn't help you, but with me there where no problems, not even with labels or command buttons.
I use VB6 (SP4)
Saludos...;)
-
You've got to be a bit tricky when resizing the form in the form resize event, cos changing the size raises the resize event, and you enter a recursive loop. You need to flag when you enter the resize loop for the first time, so that you can control whathappens when you re-enter the flag aftyer resizes the form in the resize event.
(I got distracted for about a hour while I was writng this, so I apologise if this is a repeat of anotehr post)
- gaffa