Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7694923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:25:44+00:00 2026-05-31T21:25:44+00:00

Using Delphi XE2 on Win 7 64 bit creating a 32 bit app… In

  • 0

Using Delphi XE2 on Win 7 64 bit creating a 32 bit app…

In Delphi 6 we used the tab character within a message to create a nice looking, multi-line double-column dialog.

str := 'Left item:' + #9#9 + 'Right Item' + #13#10 +
       'Next left item: + #9 + 'Next Right Item' + ...

if MessageDlg(str, mtConfirmation,[mbYes,mbNo],0) = mrYES then...

This creates a nicely lined up list of data for the user to see without the need for a custom form just to ask this particular question. The right column is nicely aligned and makes it easy to see the data clearly.

In Delphi XE2 the tab characters (#9) embedded within the string are completely ignored and there is no white space at all. Using #32 does create a space but does not nicely line up like the tab character (#9). Am I running into some Unicode issue?

Any suggestions out there to get this formatting back other than using a custom form?

Cheers!

EDIT:

Of course, after I post a question I figure out a couple different workarounds.

First, using Application.MessageBox() does maintain the tab character spacing.

Secondly and oddly, this code below works and maintains the proper white space with the tab characters.

procedure TForm1.Button1Click(Sender: TObject);
var AMsgDialog : TForm;
var str : string;
begin
  str := 'Left item:' + #9#9 + 'Right Item' + #13#10 +
         'Next left item:' + #9#9 + 'Next Right Item';
  AMsgDialog := CreateMessageDialog(str, mtConfirmation,[mbYes,mbNo],0);
  try
    if AMsgDialog.ShowModal = mrYES then begin
      //do something
    end;
  finally
    AMsgDialog.Release;
  end;
end;

Not sure why creating a message dialog this way would maintain the tab character spacing when the old way would not.

I know the same CreateMessageDialog function is hit when I call MessageDlg() so there must be something in between stripping out the tab characters. I was not able to trace into the code to find out what was stripping the tab characters.

Hopefully this helps someone else out.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T21:25:45+00:00Added an answer on May 31, 2026 at 9:25 pm

    Depending of some internals checks like the Windows version (greater or equal than vista), the value of the UseLatestCommonDialogsvariable and if the current visual Style is the native windows theme. The MessageDlg uses the TTaskMessageDialog(TCustomTaskDialog) class which internally call the TaskDialogIndirect WinApi function, This function is handled by Windows itself and as far i know there is not option to recognize the Tab chars in a special way.

    Otherwise when one of the above conditions doesn’t match the MessageDlg uses the CreateMessageDialog function to create a dialog. This method draw the dialog itself using the VCL and WinApi calls, the text of the body is drawn using the DrawText function with the DT_EXPANDTABS flag included which Expands tab characters.

    So the only way which the MessageDlg function recognizes the Tab chars is when uses the CreateMessageDialog internally (you can force this behavior setting the value of UseLatestCommonDialogs to false).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What's the workflow for creating an iOS app using Delphi-XE2. This is really a
I am trying to write an iPhone app using Delphi XE2 / FireMonkey and
Using Delphi XE2 update 3 or update 4 on Win7 64 bit. Calling enumwindows
We are porting our app to Delphi XE2 from Delphi 6. Problem is, the
I am using Delphi XE2 with help installed. I want to see the hints
Yesterday I installed Delphi XE2 using the download option, so I guess the installed
I use ActivateKeyboardLayout(HKL_NEXT, KLF_ACTIVATE); to load Persian keyboard layout using Delphi XE2, But sometimes
I'm migrating an old Delphi application (using ZeosDB) to Delphi XE2. I want to
Using Delphi 2010, I have used TSQLQuery and TSQLConnection to connect to a remote
When using Delphi's ReadLn to read values from a tab-delimited file into a series

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.