DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004

    maximising forms

    [Originally posted by Min]

    In my program I have the form set at certain size, its got a colourful background and everything, but when I press the maximize square (at the top right of the screen) the form itself maximises, but its contents doesn't. I havent been able to find anything useful on the subject. If anyone could help Id really apreciate it. Thanks, Min.

  2. #2
    Join Date
    Aug 2004

    Re:maximising forms

    [Originally posted by neophile]

    Contents maximizing? You need to resize them manually. Usually, just record the distance between, for example, the width of the control and the width of its container.
    To demonstrate, put a PictureBox on a Form, paste the following, and resize the window at runtime...

    Option Explicit

    Private mW As Long
    Private mH As Long

    Private Sub Form_Load()
    mW = Me.Width - Picture1.Width
    mH = Me.Height - Picture1.Height
    End Sub

    Private Sub Form_Resize()
    On Error Resume Next
    Picture1.Width = Me.Width - mW
    Picture1.Height = Me.Height - mH
    On Error GoTo 0
    End Sub

    I hope this gets you started.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.