Tab characters no longer work in Delphi XE2 message dialogs - alternatives?

前端 未结 1 1642
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-22 09:48

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 dialo

相关标签:
1条回答
  • 2021-01-22 10:32

    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 讨论(0)
提交回复
热议问题