Results 1 to 3 of 3

Thread: Resizing Problem...PLEASE HELP!

  1. #1

    Thread Starter
    PowerPoster eiSecure's Avatar
    Join Date
    Jul 2000
    Location
    Texas
    Posts
    2,209
    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.

  2. #2
    Guest
    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.

  3. #3
    Guest
    See This tip

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width