Results 1 to 4 of 4

Thread: [RESOLVED] [2005] Increase form size

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2005
    Posts
    331

    Resolved [RESOLVED] [2005] Increase form size

    How do I increase a form size with the click of a button? I tried
    Me.Size.Height but that does not work! I always get an error. How do I fix it?
    Last edited by 3dmaker; Jun 13th, 2006 at 12:40 AM.
    Katya Chehova is best!

  2. #2
    Lively Member
    Join Date
    Jan 2006
    Posts
    108

    Re: [2005] Increase form size

    Try
    VB Code:
    1. Me.Height += 60
    This will increase the forms height with 60
    VB.Net 2005 Express
    .Net Framework 2.0

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] Increase form size

    You cannot edit the Height and Width through the Size property because a Size object is a value type object. If you want to change just the Height or just the Width then the form has properties so named:
    VB Code:
    1. Me.Height = 200
    2. Me.Width = 300
    If you want to set them both though you should set the Size property. You do this by creating a new Size object:
    VB Code:
    1. Me.Size = New Size(300, 200)
    The same applies to the Location property. You can set the Top and Left individually or you can create a new Point object and assign it to the Location property.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2005
    Posts
    331

    Re: [2005] Increase form size

    That code works perfect. Thanks JM!
    Katya Chehova is best!

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