Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2010
    Posts
    175

    Unanswered: Auto Size a Form Window

    Seeking assistance in setting properties for a form so that when opened, viewers can only see the necessary portion of the form.

    I thought it was the Can Grow/Can Shrink properties, or the Allow auto re size..but I'm not having any luck.

    How do I do this?

    Thanks.

  2. #2
    Join Date
    Oct 2003
    Location
    London
    Posts
    341
    Is there a reason why you can't have a form without the portion of the form that you want to hide?

    How much are you actually trying to hide?

  3. #3
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You need to use the Move method of the Form object. Here's an example that reduces both the height and the width of a form by 2, without actually moving it (i.e. its left corner does not move on the screen):
    Code:
    Private Sub Command_Shrink_Click()
    
        Me.Move Me.WindowLeft, Me.WindowTop, Me.WindowWidth / 2, Me.WindowHeight / 2
        
    End Sub
    If you specify absolute values as arguments, do not forget that they must be expressed in twips (there are 1440 twips in an inch, 567 twips in a centimetre).
    Have a nice day!

  4. #4
    Join Date
    Oct 2010
    Posts
    175
    Yes, there is a reason. I think it looks better.

  5. #5
    Join Date
    Oct 2010
    Posts
    175
    Sinndho, how would I go about doing this? I am unfamiliar with this method. Would I just copy the above code and use it? Thanks.

  6. #6
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Paste the code into the form module, changing the arguments (width and height) of the Move method to fit your needs and call the procedure whenever you want (Form_Open, Button_Click, Mouse_Move, etc.
    Have a nice day!

Posting Permissions

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