CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Width of forms

  1. #1
    Guest

    Width of forms

    I have a form w/c has a label used for displaying custom messages. How can I vary the width of this form (& label) in accordance to the length of the custom message? For instance, the width of the form w/ the message "Database updated!" is shorter than when the message "Computing Interest & Withholding Tax..." is shown. Thanks.


  2. #2
    Join Date
    Sep 1999
    Location
    Red Wing, MN USA
    Posts
    312

    Re: Width of forms

    Tryrivate Sub Form_Load()
    Label1 = "CodeGuru is one of the best VB sites!!"
    End Sub

    private Sub Label1_Change()
    Label1.AutoSize = true
    Width = Label1.Width + (Label1.Left * 2) + (Width - ScaleWidth)
    End Sub



    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]
    Aaron Young
    Senior Programmer Analyst (Red Wing Software)
    Certified AllExperts Expert

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

Featured