+ Reply to Thread
Results 1 to 4 of 4

Make Form Full Screen and Auto-Center Textbox

  1. #1
    Forum Contributor
    Join Date
    09-12-2015
    Location
    Okinawa, Japan
    MS-Off Ver
    2013
    Posts
    178

    Make Form Full Screen and Auto-Center Textbox

    I found this code that re-sizes the VBA form to match the screen size. Is there a way to auto-center a TextBox on that form as the screen changes sizes and the form re-sizes to match?

    Thank you for any ideas or input.

    Ken

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,900

    Re: Make Form Full Screen and Auto-Center Textbox

    Hi, yes, the same way you center the userform but using the textbox parameters

    Please Login or Register  to view this content.
    This is Aircode, not tested.
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Forum Contributor
    Join Date
    09-12-2015
    Location
    Okinawa, Japan
    MS-Off Ver
    2013
    Posts
    178

    Re: Make Form Full Screen and Auto-Center Textbox

    Thank you Keeblellah, great input. Okay, so this is what I have so far...


    Please Login or Register  to view this content.
    This code maximizes the form to the screen size and centers the TextBox1 on the form. All works great. Can you tell me how to have 2 Text Boxes on a form and have it space them equally apart from each other? I tried for over an hour with different variables with no success. Your help is appreciated.

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,900

    Re: Make Form Full Screen and Auto-Center Textbox

    You will have to figure that one out.
    It will be something like yourself.
    That will have to hold both textbox heights in a variable + the space in between and do your own calculations.
    If you do this in design mode and place the textboxes accordingly then you can see the positions, move them around and see the measurements again. Use this knowledge to build your code, that's the way I do it.
    It'll take time but that's what programming is all about.
    Using the principle I gave you for horizontal centering you might be able to do it for both

+ 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. Replies: 4
    Last Post: 04-26-2021, 12:26 AM
  2. How do I make Excel stay in Full-screen ?
    By white-k in forum Excel General
    Replies: 2
    Last Post: 04-10-2015, 12:30 PM
  3. How make Excel-document load up in full screen?
    By white-k in forum Excel General
    Replies: 18
    Last Post: 08-01-2013, 01:47 PM
  4. Auto-Center a Workbook On Any Screen
    By Balddaddy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-15-2013, 01:40 AM
  5. macro to force auto full screen
    By copythat in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-30-2011, 08:52 PM
  6. full screen form
    By samtwilliams in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-02-2007, 06:07 AM
  7. How to make user forms FULL SCREEN?
    By Fendic in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-24-2005, 02:05 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