+ Reply to Thread
Results 1 to 4 of 4

Buttons to move in relation to userform on screen

  1. #1
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    418

    Buttons to move in relation to userform on screen

    Good Afternoon Folk

    I have a userform with several command buttons, labels text boxes etc on the screen. When the workbook opens the form will adjust to the size of screen it open on.

    On a standard 17" screen its fine with everything where it should be,,, however when its opened on a widescreen the form adjusts itself but the buttons and labels remain where they would be for 17"

    Is there a way to have everything within the form adjust its position on the screen in relation to the form?


    Many thanks for your help

    JT

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2405
    Posts
    25,028

    Re: Buttons to move in relation to userform on screen

    There is nothing automatic that will do this for you. If you really want to make this a responsive design then you have to scale the positions of all the buttons and labels and set them individually in the same code that adjusts the form size. I have not written code that retrieves the display size, but once you have that it should be fairly straightforward arithmetic to place the controls. I would set up positioning of the controls based on the percentage of the form height and width then just apply those percentages to the adjusted form dimensions once you adjust it for the screen proportions.

    I am trying to guess why you are concerned about this--do you need the form to fill the entire screen?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    418

    Re: Buttons to move in relation to userform on screen

    Hi 6StringJazzer

    I don't need the form to fill the screen,, it currently does and looks good on the normal screen...when its opened on the wide screen it fills the screen but the buttons obviously remain in their original position...... it doesn't look too bad but I just thought it would be nice if they could reposition themselves to balance up the form

    Many thanks for your help and information.... I'll use the advice to try it

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,468

    Re: Buttons to move in relation to userform on screen

    You might find this helpful.
    http://www.andypope.info/vba/Anchor.htm

    You could also play with the zoom. This will resize form contents.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Why Userform Buttons Don't Match System Buttons?
    By msleger in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-23-2008, 12:43 PM
  2. Using VBA to move screen selection
    By MDubbelboer in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-23-2006, 05:50 PM
  3. [SOLVED] why don't buttons in the header dialog box show screen tip?
    By AvidStudent20885 in forum Excel General
    Replies: 1
    Last Post: 03-27-2006, 11:10 AM
  4. Move the position of spreadsheet on the screen
    By Souris in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-23-2005, 01:05 AM
  5. Replies: 3
    Last Post: 02-25-2005, 03:06 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1