Multi-line command-button lable?

I wish to have a command button which displays something like this:
+         Good            +
+      Afternoon        +

Where the lable is split over two lines, and the words "Reasonably" centered.
And I'm not fully sure which fonttype I'll use for the button, could be Courier, could be Tahoma, could be anything really.

Now in the developing environment, I have no problem with adding spaces and removing them to visually lay it out, I've done that no problem...  The problem comes in when the SYSTEM FONT SIZE changes.  System-font size, the one that is set through the Screen properties (one of the tabs one comes across when changing the screensaver or themes and such) {In XP, this is the monitor-advanced "DPI settings, normal/large", in other windows versions its the "Small fonts, large fonts or NNN% sized fonts)

When the System font size gets changed, the same space-padded lable generates an output like the following
+      Good               +
+  Afternoon            +

I currently have a function which will return true/false if the system is in NormalFonts (small) or LargeFonts (large), I'm not really interested in custom-sized system font displays at this time, but for completeness, I might be later.  I can choose between two different strings which I have to develop in designtime with my computer in each mode, and pick the lable that way, which is the current way I am using, but a way I wish to replace because its dependant on the design-time conditions.

I wish to have a routine that will stamp the lable onto the command bar using TWO STRING COMPONENTS Line1 and Line2.
The assumptions / intentions to be used:
-- Line1 and Line2 will both be narrower than the command button, no wrapping will occur
-- Font type nonspecific, so should be based on character width of the strings when chosen
-- Even if line1+line2 text < width of button, STILL to be shown as two lines
-- Needs to work in both large and small font modes

I know a solution is just out of my reach, or I'm not looking at something right.
No third-party controls, please, even if you really like one...

Who is Participating?
Harisha M GCommented:
Hi GPrentice00,

Add this to the load event...

Private Sub Form_Load()
    Command1.Caption = "Good" & vbCr & "Afternoon"
End Sub

Harisha M GCommented:
    vbCr, vbLf, vbCrLf -- any one of these will do the job
GPrentice00Author Commented:
of course it would be that obvious - I tried the VBCR and VBCRLF before, but there was something else with my stupid button that must have caused a problem, making me go down the winding road...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.