Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Msg Box (Change colour/font etc..)

Status
Not open for further replies.

aarondewberry

IS-IT--Management
Jul 20, 2005
148
GB
All

See example of msgbox.
What i want to do is make the word "Example" on line 2, bold and the colour red. If that is not possible, can I make the whole line bold and red. Without it affecting the other lines.

MsgBox "Line 1 Example string" & vbCrLf & _
"Line 2 Example string" & vbCrLf & _
"Line 3 Example string" & vbCrLf & _
 
I've seen this come up before ( the short answer is no, you can't ) :


( the long answer is to use a userform instead, or the very very long answer is to use APIs ).

Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
>the very very long answer is to use APIs

Sadly not so easy for this question as in the thread in which I present that code.

The problem is that the MsgBox presents its text in what VB terms a label control - and ypu can only apply one font style to a label control - whilst the user here wants multiple styles. In their case a custom form would probably be the best bet.
 
Ah strongm, I should have read the small print. Thanks for putting me straight on that.

Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top