[Wish] MsgBox2 centered text

MikeH

Well-Known Member
Licensed User
Longtime User
If there isn`t already a simple method, (I have looked), could the MsgBox2 function have the option to center text?

It would make my coding a lot easier, instead of padding out with spaces for each eventuality.

Maybe someone will tell me there is already a way, I would be happy with that too :)

Thank you!
 

Mahares

Expert
Licensed User
Longtime User
Check out NJDude's custom msgbox class in the following link. I am pretty sure it will do what you want:
http://www.b4x.com/forum/additional...tes/23041-class-custom-msgbox.html#post133618

If you want to center the msgbox text there, add the line below to the CLASS module sub: Public Sub ShowMessage(BoxMessage As String)

B4X:
Public Sub ShowMessage(BoxMessage As String)
Dim su As StringUtils
Message.Text = BoxMessage
Message.Gravity=Gravity.CENTER_HORIZONTAL  'Add this line Mahares
 

MikeH

Well-Known Member
Licensed User
Longtime User
Thank you Mahares, I will try that.

Erel, is it possible, in a future release, that the msgbox2 could have a Boolean option to say centered or not?
 
Top