DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004
    Posts
    43,023

    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
    Posts
    43,023

    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.

Bookmarks

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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links