Centralized msgbox text

Cassio

Junior Contributor
Joined
Nov 30, 2002
Messages
276
Location
Rio de Janeiro
Is there a way to centralize the text inside a msgbox automaticaly?

like this:
Visual Basic:
        The second line appears in the middle of
                the messagebox

and not this:
Visual Basic:
        The second line appears on the left side
of the messagebox.

thanks!
 
Not unless you make your own "fake" messagebox using a form
and it's ShowDialog function.
 
i dont like the idea of fake msgboxes i fink its not controllable
i mean ull have a label obviously

and the thing is wat happens if the scale of the amount of text is so much then wouldnt the text be unseen , i mean the other half of it, cause how would the form automatically resize itself to the right size for the text
 
You would need to code in the resizing yourself...

Also, you don't NEED to use a label; you could use the GDI+ (System.Drawing)
to draw the text and image.
 
You say you don't like the idea of "fake" messagebox's, but what you want is a non-standard messagebox. Or, to put it differently, you really don't want a message box at all :)

If you decide to code your own, you can use the Graphics object's measurestring method to get the size of text to make sure your label will be big enough. Actually, you can change the size of your form and assuming you set the anchor property of the label, the label will resize automatically.

-Nerseus
 
Back
Top