|
-
Feb 20th, 2003, 02:38 PM
#1
Thread Starter
PowerPoster
VB Snippet - Limit Form Resize
VB Code:
'*******************************************************************************
' MODULE: Form1
' AUTHOR: Speedy
'
' DESCRIPTION:
' LIMIT FORM RESIZE EXAMPLE
' YOU WILL NEED TO HANDLE THE FLICKERING EFFECT !!!
'*******************************************************************************
Option Explicit
'*******************************************************************************
' Form_Load (SUB)
'
' DESCRIPTION:
' ACTION ON FORM LOAD
'*******************************************************************************
Private Sub Form_Load()
' RESIZE THE FORM
Call Form_Resize
End Sub
'*******************************************************************************
' Form_Resize (SUB)
'
' DESCRIPTION:
' ACTION ON RESIZE OF FORM
'*******************************************************************************
Private Sub Form_Resize()
On Error Resume Next
Dim WMIN As Double, HMIN As Double
WMIN = 2500
HMIN = 2500
If Me.Width <= WMIN Then
' DO NOT ALLOW WIDTH TO BE SET BELOW MINIMUM
Me.Width = WMIN
End If
If Me.Height <= HMIN Then
' DO NOT ALLOW WIDTH TO BE SET BELOW MINIMUM
Me.Height = HMIN
End If
End Sub
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Jun 17th, 2003, 06:00 AM
#2
Fanatic Member
it would be way better to sub-class the form, then, you can limit the size before the drawing is done!
Best Regards,
seec77
If you helped me, cosinder yourself thanked.
Get each and every Garfield strip here!
Here you can get all Calvin & Hobes strips!
Damn UComics! It was probably unprofitable for them to allow us to just download Garfield and Calving & Hobes strips... so they made folder indexing unallowed on their server!!!
I am 33% addicted to Counterstrike. What about you?
I am 23% addicted to Star Wars. What about you?
I am 0% addicted to Tupac. What about you?
-
Jun 18th, 2003, 12:33 AM
#3
Lively Member
i use something similiar to that... but how do you stop for form from flickering???
it is a real pain...
Cheers
-
Jun 18th, 2003, 03:12 AM
#4
Search this site for WM_SIZING - there are numeruous examples of flicker-free resize control.
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
|