Resize form controls, when Maximize.
Resize form controls, when Maximize.
API Declarations
Discovered that not all controls will resize automatically when a form maximizes. This is simply because that they don't get enough time too. To get around this you simply make a procedure which gets called by a timer control which enables and disables when ever the form is resized. It came in handy for me and hope it comes in handy for you. Merry HoHo's.
Rate Resize form controls, when Maximize.
(1(1 Vote))
2/On the main form add a timer control. set the time to "1" and the enabled to "false". Also add a textbox to the main form.
3/Either create a new module or add this code to your current form.
4/Create a procedure something like the following.
Public Sub Resize_Form()
With Form1
if .WindowsState<>1 then
Text1.Left=.ScaleLeft
Text1.Top=.ScaleTop
Text1.Width=.ScaleWidth
Text1.Height=.ScaleHeight
End If
End With
End Sub
4/Under the timer control add the following code.
Sub Timer1_Time()
Resize_Form
Timer1.Enabled=False
End Sub
5/Under the main form resize event add the following code.
Sub Form1_Resize()
Timer1.Enabled=True
End Sub
6/Run the program and watch the form automatically get resized.
Resize form controls, when Maximize. Comments
No comments yet — be the first to post one!
Post a Comment