I am trying to display a string with tabulator characters inside of a MessageDlg. The tabs inside the string are not recognized and displayed properly. I'm pretty certain it has to do with the MessageDlg and not the string itself as it displays properly inside of a TRichEdit component.
I've not yet tried to replicate the result in other versions of Delphi and this is the only relevant article I've found so far: https://forums.embarcadero.com/message.jspa?messageID=710405
sInfo := #13 + 'Name:' + #9 + sName + #13 +
'Surname:' + #9 + sSurname + #13 +
'Address:' + #9 + sAddress + #13 +
'E-mail:' + #9 + sEmail + #13 +
'Phone:' + #9 + sCell;
iConfirm := MessageDlg('Add the following member info: ' + sInfo,
mtConfirmation, mbYesNo, 0);
I expect the string to be displayed in 2 columns inside the MessageDlg but it is displayed as follows: 'Name:Janrich'
Possible duplicate of Tab characters no longer work in Delphi XE2 message dialogs - alternatives?
I personally would create a form for this purpose, containing a readonly Memo control. The form would be shown using
ShowModal. This has the advantage that the user can copy-paste the text. Using buttons that have theModalResultproperty, you can also get the Yes/No result back.