Hi
I am looking for MsgBox features, controls, formatting, whatever you call it, I want to center the message on a msgbox, by default it is always left.
Hi
I am looking for MsgBox features, controls, formatting, whatever you call it, I want to center the message on a msgbox, by default it is always left.
Hello CobraLAD,
The best method is create a UserForm to do this. To do what you want with a message box with VBA is insanely complicated. The UserForm allows you an easy way to customize your message interface.
Sincerely,
Leith Ross
Hi CobraLAD... Try this code...
I use it to centralize the text in msg... (using Visual Basic, not VBA)... Maybe it works !!!![]()
Function Msg(ParamArray parm()) Dim a For a = LBound(parm) To UBound(parm) If Len(parm(a)) > max_len Then max_len = Len(parm(a)) End If Next a For a = LBound(parm) To UBound(parm) If Len(parm(a)) < max_len Then spaces = (((max_len - Len(parm(a))) / 1.6)) For b = 1 To spaces parm(a) = " " & parm(a) & " " Next b End If msgstring = msgstring & parm(a) & Chr(10) Next a MsgBox msgstring End Function Sub Testar_Msg() Dim a As String a = Msg("Esta é uma frase que está na 1ª linha;", "Esta está na segunda;", _ "Esta encontra-se na terceira linha", _ "e esta na 4ª, mas a mensagem está toda centralizada!") End Sub Private Sub Form_Click() Testar_Msg End Sub
Marcos
Last edited by socram_06; 10-10-2007 at 12:14 AM.
Thx Leith Ross
I understand
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks