Results 1 to 9 of 9
  1. #1
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Fit Form to Window (VB6)

    Is there an alternative command in VB to maximise a form to a window, or do I need to use something like MoveSize.
    My screen resolution is 800x600.

    In Access I would usually use DoCmd.Maximise.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Fit Form to Window (VB6)

    Are you building an MDI (multiple document interface) application, with a parent window and child windows within the parent window?

  3. #3
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Fit Form to Window (VB6)

    Hans

    This is only a single form with one PDF Control. (If thats what you mean.)
    I don't plan on anything added other than a couple of buttons.
    It's as the demo posted a couple of days ago.
    Thanks

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Fit Form to Window (VB6)

    Unless you write a lot of complicated code to reorganize the form if it is maximized or resized, it doesn't make much sense to maximize a single-form VB application. Remember that the application runs by itself, it doesn't live within a larger application window, the way an Access form lives within the Access application window.

  5. #5
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Fit Form to Window (VB6)

    Yes I understand what you're saying Hans, I just feel that a single form looks far better on the monitor when it is maximised and not showing any of the desktop around it's borders.

    I think in this case, I would probably be better just resizing the form and it's controls (Thats if they keep to these sizes in EXE format).

    Thanks for the information anyway.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Fit Form to Window (VB6)

    To maximize a form, set its WindowState property to vbMaximized:

    Me.WindowState = vbMaximized

    You can do this in the Load event of the form.

  7. #7
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Fit Form to Window (VB6)

    Thanks again Hans, I was just playing with the .Height .Width & the .Move settings.
    I found the WindowState in the properties, which works ok.

  8. #8
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Fit Form to Window (VB6)

    I think height and width will resize a "normal" AKA "restored" window, which is different than maximizing a window, at least from the perspective of what the user might do to it with the standard controls just to the left of the right-hand side "X" button. I guess if there's not a regular Windows title bar on the thing, the differences are minor.

  9. #9
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Fit Form to Window (VB6)

    >I just feel that a single form looks far better on the monitor when it is maximised and not showing any of the desktop around it's borders.

    Speaking personally, I find that such forms are the same as someone saying DON'T YOU DARE THINK OF ANYTHING ELSE while I'm trying to get my work done.

    OTOH vbMaximised is much simpler to code than using interrogating code for screen resolution and then displaying at a percentage! <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Gre

Posting Permissions

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