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

Thread: Resolution

  1. #1
    Join Date
    Jul 1999
    Posts
    84

    Resolution

    Hi,

    I would like to know how can I keep the size of the forms the same irrespective of the systems resolution.

    Right now I am giving the height and width of the forms explicitly and placing the forms as I need. But,if the systems resolution is changed then the forms are being displayed beyond the screen limits.

    It would be great if you can give me any suitable suggestion to solve this problem.

    Thanks
    Harini
    Even Impossible says I'm possible

  2. #2
    Guest

    Re: Resolution

    There is a way, but it involves using some Windows API functions - you find out the screen resolution and resize your forms, or even the controls on the forms as well. Ken Getz/Mike Gilbert show you how in "Access 97 Developer's Handbook", Sybex, ISBN: 0782119417. It's a superb book (superseded by the Access 2000 version) and comes with a brother (set) "VBA Developer's Handbook" ISBN: 0782119514 - both highly recommended. Alternatively, try searching sites like MVPS' site (http://www.mvps.org/) for example code snippets. Alternatively, abide by the Windows design guide and create your forms for 800x600 or whatever it is these days.

    Mark


  3. #3
    Join Date
    Aug 2000
    Location
    Malaysia
    Posts
    3

    Re: Resolution

    try this and see, whether it's help or not

    ' Centre Form
    Form1.Left = (Screen.Width - Form1.Width) / 2
    Form1.Top = (Screen.Height - Form1.Height) / 2
    Form1.WindowState = 2 'maximized - and this is optional



  4. #4
    Join Date
    Aug 2000
    Location
    Malaysia
    Posts
    3

    Re: Resolution

    continue....
    pls place the code's in the Form_Load event...




  5. #5
    Join Date
    Jul 2000
    Posts
    223

    Re: Resolution

    I tried to do same thing by using SysInfo Control which have ability to track changes of resolution (and some other system events) but I didn't finished it yet. However, I found the event bellow as possibly useful:
    SysInfo_DisplayChanged

    - This is a SysInfo Control's event which occurs when system screen resolution changes. Comment from MSDN about this event is:
    "Use this event to make any adjustments you need to the interface of your application due to changes in screen resolution."

    I'm not sure that this is a right way to do this, but maybe you will give it a try ...

    Good Luck

    Sead








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