Centering Text in a MsgBox?

Troy

Well-known member
Joined
Feb 7, 2005
Messages
153
Programming Experience
10+
Is it possible to have a center command or something to center some text in a MsgBox.

I have this :

Dim msg As String

Dim title As String

Dim style As MsgBoxStyle

Dim response As MsgBoxResult

msg =
"Save changes made to Customer Record [" & CIDText & "]?" & Chr(13) & Chr(13) & "Changes made to this record will be final!" ' Define message.

style = MsgBoxStyle.YesNoCancel

title =
"Save?" ' Define title.


This creates a Yes, No, Cancel message box with The first Line Save changes made... displayed fine. chr(13) is linespace(enter) then Changes made... is on like the 3rd line down.

What I would like is to get Changes made centered horizontally in the form if possible.

I know in html you can say <center> </center> to do this.

Is there anything I can use in chr() to simulate the same effect?

Or does anyone have any ideas short of making a custom form.

 
if you cannot center it, do spaces at the start or yet better make your own pop up box (MessageBox) form with label inside then just use myMsgBox.Show() and me.Close.

I beleive it's (own form that acts like msgbox) the best choice altrough there is a possible way (i'm not fully sure but we can try however) way to override the messagebox ... btw, i wouldn't recommend it

Cheers ;)
 
Probably want to use the ShowDialoge if you build your own. Using .Show will show the form, and let things keep right on going. Using .ShowDialoge will stop execution just like a nore mal MessageBox.

Tg
 
Back
Top