|
-
Aug 11th, 2000, 09:48 PM
#1
Thread Starter
PowerPoster
Hi, I have a little problem. My program lets its users resize the form as needed, but I want whats on the form to adapt to the size. Heres what I have so far, but lets say you resize the form at execution, and you make the height 0, and you resize it back again. When you resize it back again, the controls just remain the same size. Any ideas?
Code:
If txtCode.Height <= 495 Then
'txtCode.Height = 495
Exit Sub
End If
txtCode.Move 0, 0, ScaleWidth, ScaleHeight
txtCode.Height = txtCode.Height - 495
If WB1.Height <= 495 Then
'WebBrowser1.Height = 495
Exit Sub
Else
WebBrowser1.Move 0, 0, ScaleWidth, ScaleHeight
WebBrowser1.Height = WB1.Height - 495
End If
Also, can you help me whith positioning buttons the same way,except I don't want them stretched.
-
Aug 11th, 2000, 11:57 PM
#2
In form_resize, size your controls there.
Adjust these following to fit your needs:
Code:
Private Sub Form_Resize()
On Error Resume Next
Text1.Height = Me.Height - 800
Text1.Width = Me.Width - 500
Command1.Width = Me.Width - 3000
End Sub
It's not the best, but it's a start. The On Error Resume Next is for when the form is minimize or shrunken to a really small size where the Textbox or Command button can't be subtracted by it anymore.
-
Aug 12th, 2000, 09:33 AM
#3
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
|