Topic: Align Text In MessageBox

Hi Everyone,
Does anyone have any idea how to solve the problem described below?
1.  I have a small word game where the user tries to guess a randomly generated word (screen1).
2.  Once the word has been guessed (or after the 6th attempt) I use 'messagedlg' to display a message box spread over 4 lines of text (screen2).
What I would like to do is align (centre) the 4 lines of text so that it appears like this (screen3).
Does anyone have suggestions how to do this (or will I just have to write my own message box instead?).
Using Windows10 / MVD 6.5.
Thanks,
Derek.

Post's attachments

Attachment icon WordWorth Puzzle Game.zip 56.85 kb, 25 downloads since 2024-07-27 

Re: Align Text In MessageBox

Hello Derek
How are you?
I'm afraid that for what you want to achieve, it's a lot to ask of this poor MessageDlg which is really basic.
I've looked on the net to see if an answer existed but none mentions centering the characters of the text.
I'm afraid that you'll have to create your own message box (well, afraid! No, it can add something to your project.
Sincerely
JB

Re: Align Text In MessageBox

Re-Hello Derek
It's me again
Or, create your own shape, put a TLabel on it, enable Wordwrap and Alignment and it might do it.
Keep us posted
JB

Re: Align Text In MessageBox

Hi Derek, Jean

How are you ?

The shortest and easiest solution would be to create your own message box. )))

Re: Align Text In MessageBox

Salut Jean, Привіт Sparrow,
All good here thanks - I hope it's the same with yourselves.
I didn't think there was any option to format the message box but thought I'd ask just in case I was missing something.
So as you've both suggested, I've just written my own (simply 4 text fields with 'centre' justification placed on a panel.  It looks a lot neater now.
Thanks for your support,
Derek.

Post's attachments

Attachment icon screen4.jpg 58.05 kb, 7 downloads since 2024-07-27