multi-line MsgBox with some lines centred?

ssfftt

Well-known member
Joined
Oct 27, 2005
Messages
163
Programming Experience
1-3
[solved]multi-line MsgBox with some lines centred?

I have a message: Your Name Is: ABCWhen the message shows, I want "Your Name Is" to be shown on first line, and "ABC" to be shown on second. I can do this by having " & vbNewLine &".However, I want "ABC" on the second line to be centered (align center).Can anyone help please?
 
Last edited:
The best you can do is to add tabs (vbTab or char(9)) as part of the string. But there's no way to automaticaly center part of the text. At least as faras I know there isn't a way.

-tg
 
The only way I can even see it being possible is if you create your own dialogbox. MessageBox doesn't have a set width to adjust to. It expands and contracts with its contents.
 
Yeah sevenhalo is right, u'll have to build ur own custom control (a messagebox in this case) & expose the align property of the label item u'll use to center the text to be displayed.
 
sounds complicated, I think that's not what I should be doing at this stage, I am learning VB.NET by trying to build a project, so, I will try to make the project work first.thanks anyway sevenhalo and smerch, I almost completed my userlogin form, only thing left is some validation and to make it look better. I will be moving on to other major functions now :) (more questions for u guys)
 
Back
Top