Results 1 to 3 of 3

Thread: Form always maximized

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2006
    Posts
    33

    Form always maximized

    I'm using 4 child forms inside a Parent form. In one form I'm using 5 frames. When I go from one form to another form (with frames) and I want only one frame to be visible, I'm not able to see it in the full window. I'm doing it manually every time. Is there any way to keep all teh frames and forms in maximized position?

    In the properties of all forms, I have made the WindowState as 2-Maximized only.

    Ths is the code i use d to switch between forms

    Form2.Hide
    Form1.Visible = True
    Form1.Frame1.Visible = True
    Form1.Frame2.Visible = False
    Form1.Frame3.Visible = False
    Form1.Frame5.Visible = False

  2. #2
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Form always maximized

    The property WindowState sets your forms to 2 - Maximized only, only at startup. Use this in every Form:

    VB Code:
    1. Private Sub Form_Resize()
    2.     If Me.WindowState <> 2 Then Me.WindowState = 2
    3. End Sub

  3. #3
    Hyperactive Member
    Join Date
    Apr 2004
    Posts
    342

    Re: Form always maximized

    Any controls, including frames need to be resized by you or an OCX when a form is resized... Search for forum for resize and you should find plenty of OCX's, Classes and plain code to resize stuff on the form.

    But if it is just five frames, you may want to just size them in the Form1_Resize Event:

    VB Code:
    1. Private Form_Resize()
    2.  
    3.   Form1.Frame1.Move 0,0,form1.scalewidth,form1.scaleheight
    4.   Form1.Frame2.Move 0,0,form1.scalewidth,form1.scaleheight
    5.   Form1.Frame3.Move 0,0,form1.scalewidth,form1.scaleheight
    6.   Form1.Frame5.Move 0,0,form1.scalewidth,form1.scaleheight
    7.  
    8. End Sub

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