dcsimg
Results 1 to 7 of 7

Thread: Align a Form and it's control

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2012
    Location
    Tiruvallur, India
    Posts
    201

    Align a Form and it's control

    I would like to know how to align a Form and all the controls in it, all the Font sizes in it - according to the Monitor's Screen size/resolution whatever it is.
    My object is whatever size i may design My Form, has to FIT to the length and width of any Monitor in which it's being viewed. Can anyone help me please...

  2. #2
    Hyperactive Member mbutler755's Avatar
    Join Date
    May 2008
    Location
    Peoria, AZ
    Posts
    417

    Re: Align a Form and it's control

    I use the anchors of the controls in order to dynamically size forms for different resolutions. It may take some experimentation, but it's pretty easy once you get the hang of it.
    Regards,

    Matt Butler, MBA, BSIT/SE, MCBP
    Owner, Intense IT, LLC
    Find us on Facebook
    Follow us on Twitter
    Link up on LinkedIn
    mb (at) i2t.us

    CODE BANK SUBMISSIONS: Converting Images to Base64 and Back Again

  3. #3
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,057

    Re: Align a Form and it's control

    Quote Originally Posted by raghavendran View Post
    My object is whatever size i may design My Form, has to FIT to the length and width of any Monitor in which it's being viewed.
    You can retrieve the primary monitor's work area by using this simple clsGetWorkArea.zip class. See this thread for more helpful info.
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jul 2012
    Location
    Tiruvallur, India
    Posts
    201

    Re: Align a Form and it's control

    Bonnie..

    Using the method suggested by you, i see the form's width changes to the monitor's width. But I have all my controls in a FRAME.
    This Frame size does't change. Some of my button controls in the bottom of the frame goes down the screen. I need to scroll to see these buttons.
    I want to avoid this situation. That's what I meant by "to align a Form and all the controls in it" in my Post # 1.

    Mbutler :

    Can you show me some e.g (coding method) how to achieve it by your way..

  5. #5
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,057

    Re: Align a Form and it's control

    Can you post the code you're using for resizing your controls? It would also be really helpful if you could provide a screenshot of your Form. Finally, is your issue related to high-DPI settings?
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jul 2012
    Location
    Tiruvallur, India
    Posts
    201

    Re: Align a Form and it's control

    Bonnie..
    In the Form Load event I have put the code as referred by you in your post (#3) . Except this code i don't have put any other for resizing the controls.
    The OS is Windows7. I see the DPI settings as 96dpi(100%).

  7. #7
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,057

    Re: Align a Form and it's control

    If possible, can you upload your Form to this thread?
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width