|
-
Nov 12th, 2000, 05:17 PM
#1
Thread Starter
Lively Member
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!
Kid A
18 Year Old Programmer
Visual Basic 6 & .NET Enterprise, ASP, WinXP (Advanced Server) Administration, HTML, Graphic Arts, Winsock, Learning VC++ and now maybe C#.. heh
[vbcode]
'back in the day vb6 code
Private Sub My_Life()
If Hour(Now) > 3 And Hour(Now) < 13 Then
Status = "Sleeping"
Else
Status = "Computing"
End If
End Sub
[/vbcode]
-
Nov 12th, 2000, 06:39 PM
#2
Hyperactive Member
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...
"Who Dares Wins" - "Quien se Arriesga Gana"
Mail me at: 
-
Nov 12th, 2000, 07:21 PM
#3
Thread Starter
Lively Member
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!!
Kid A
18 Year Old Programmer
Visual Basic 6 & .NET Enterprise, ASP, WinXP (Advanced Server) Administration, HTML, Graphic Arts, Winsock, Learning VC++ and now maybe C#.. heh
[vbcode]
'back in the day vb6 code
Private Sub My_Life()
If Hour(Now) > 3 And Hour(Now) < 13 Then
Status = "Sleeping"
Else
Status = "Computing"
End If
End Sub
[/vbcode]
-
Nov 12th, 2000, 08:14 PM
#4
Hyperactive Member
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...
"Who Dares Wins" - "Quien se Arriesga Gana"
Mail me at: 
-
Nov 12th, 2000, 09:04 PM
#5
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
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
|