+ Reply to Thread
Results 1 to 6 of 6

UserForm Caption Font

  1. #1
    Registered User
    Join Date
    04-07-2014
    Location
    Mahwah, New Jersey
    MS-Off Ver
    Excel 2010
    Posts
    25

    UserForm Caption Font

    I'm starting to get the hang of using UserForms as dialog objects rather than jumping around from workbook to workbook or sheet to sheet when controlling what the user interface is like. Everything is falling into place for the most part. But one minor aspect bothers me and I cannot find a way to control it.

    While the prompts and their labels are in size 10 font and bold, the caption of the UserForm remains rather small and not bold. Changing the font property of the UserForm doesn't affect the caption. I've tried to find a property of the UserForm within VBA (as well as another way to reference the form object than by it's name) and have come up short. Since the caption is like a major heading to distinguish one dialog from another, I would like for it to stand out more.

    Has anyone ever seen a means whereby the caption font can be controlled? Thank you.

    Steve

  2. #2
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Lightbulb Re: UserForm Caption Font

    Hi s_andrews,
    Though my knowledge of this is very limited; the Caption of a Userform is a part of its Title Bar (a property of the Windows OS GUI). To modify it, one would have to resort to API calls. Now, whether it is possible to modify one specific instance of a "Title Bar"? I'm not sure.

    Nevertheless, here's an alternate approach:
    • hide the "Title Bar" or Caption of your Userform using API calls (see here); and
    • then position a suitable Label at the top of the Userform to appear as the Caption you require. It is much easier to modify the Label font & background.

    HTH. Cheers!
    Jewel

  3. #3
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: UserForm Caption Font

    Quote Originally Posted by jewelsharma View Post
    Hi s_andrews,
    Though my knowledge of this is very limited; the Caption of a Userform is a part of its Title Bar (a property of the Windows OS GUI).
    +1



    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: UserForm Caption Font

    +1
    a Guru approving my response, ... made my day!
    Thanks a ton Sixthsense

  5. #5
    Registered User
    Join Date
    04-07-2014
    Location
    Mahwah, New Jersey
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: UserForm Caption Font

    Thank you for your responses. I like jewelsharma's second approach of just hiding the caption and inserting a textbox as the label/heading. That gives me complete control of the heading's font (color, size, and style) as well as it's location. But I will hide the caption simply by blanking out the Caption property rather than using API calls as suggested. Thanks again.

    Steve

  6. #6
    Registered User
    Join Date
    08-22-2011
    Location
    Berlin
    MS-Off Ver
    Excel 2010
    Posts
    51

    Re: UserForm Caption Font

    I followed the suggestion but was not satisfied with the fact that the window no longer had a handle allowing the user to relocate it.
    I decided to leave the Caption empty and place a Label underneath allowing not only to use any font and size but also adjust the form width. The result looks as follows and I am quite satisfied with it (the small bottom space is managed by an extra empty Label):
    Attachment 660162

+ 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. Get UserForm checkbox caption and pass to another UserForm on click or mouse down
    By tulsaguy71 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-08-2013, 11:07 AM
  2. [SOLVED] Change label caption's font color based on value in another textbox
    By MileHigh_PhD in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-19-2013, 01:59 PM
  3. center userform caption
    By D_Rennie in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-08-2009, 10:16 AM
  4. [SOLVED] Userform Caption
    By Jason Zischke in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-05-2006, 03:55 AM
  5. [SOLVED] button caption font shrinking
    By JeffP in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-15-2005, 07: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