CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2000
    Location
    India,Bombay
    Posts
    48

    Screen Resolution

    Is there any ocx or any one can give me sample code uising which my form will remain unaffected even if the screen resolution is increased or decreased ?

    Thanks,
    [email protected]



  2. #2
    Join Date
    Aug 2000
    Location
    NY, USA
    Posts
    632

    Re: Screen Resolution

    Sheridan Resize control is pretending to do that, but does it not so good. Actually, if your form contains intrinsic Combo Box, it can be a problem with all resizers, because there is no way to change the height of Combo (only by changing its font, which is not flexible enough). Try to play with Sheridan (www.shersoft.com), they give fully functional trial version.
    Vlad


  3. #3
    Join Date
    Mar 2001
    Location
    Pa. USA
    Posts
    3

    Re: Screen Resolution

    I've had some success using code from the Access97 Developer's Handbook (3rd edition, Sybex)Chapter 8 - "Screen Resolution and distributing forms". The code uses API calls and of course needs to be altered for use with VB vs. Access. Mainly most of the references to portions of an Access form have to be removed.

    Best Regards, Roy Kalin

  4. #4
    Join Date
    Jun 2000
    Location
    Nepal
    Posts
    108

    Re: Screen Resolution

    The following is a simple code that you can use to make a form designed in 800x600 mode uniform over all resolutions.


    private Sub Form_Load()
    on error resume next

    Dim CtrlVar as Control

    Xratio = Screen.Width / (Screen.TwipsPerPixelX * 800)
    Yratio = Screen.Height / (Screen.TwipsPerPixelY * 600)

    for Each CtrlVar In FrmVar.Controls
    CtrlVar.Left = CtrlVar.Left * Xratio
    CtrlVar.Top = CtrlVar.Top * Yratio
    CtrlVar.Width = CtrlVar.Width * Xratio
    CtrlVar.Height = CtrlVar.Height * Yratio
    CtrlVar.Font.Size = CtrlVar.Font.Size * XRatio
    next CtrlVar
    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

Featured