CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2001
    Posts
    60

    Setting automaticly the form and controls size

    I want to know if it's possible to set automaticly the size of forms and controls for a specific screen size or resolution...
    Because I have a program know that contains forms wich can be easily viewed on a 17'' screen. But it has to be seen also on a 14'' screen...
    Do someone have an idea ??

    Make it with rocker style \w/

  2. #2
    Join Date
    Dec 1999
    Location
    Bangalore
    Posts
    60

    Re: Setting automaticly the form and controls size

    U can use this Active-x control developed by Sudhir Rakode...

    http://www.planet-source-code.com/xq...s/ShowCode.htm

    -Venky
    Rate it if u like it...


  3. #3
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Setting automaticly the form and controls size

    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



    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  4. #4
    Join Date
    Aug 2001
    Posts
    60

    Re: Setting automaticly the form and controls size

    I used the .ocx but it don't seems to work too much...
    I designed my forms in 1154 X 864
    But I don't see it much in 800 X 600

    I tried Iouri's code also. But it did'nt worked neither.

    Make it with rocker style \w/

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