Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RTL layout issue for Property Sheets (MFC)

I am running my English application in Arabic Windows. It contains a property sheet UI (MFC). Everything seems to be fine (Left-To-Right or LTR), except the buttons (OK, Cancel, Apply, and Help) which are Right-To-Left or RTL. But how to make the buttons LTR?

  • I played around with the flag PSH_RTLREADING mentioned on MSDN but it only deals with the window caption, not the buttons.

  • Besides, I noticed this dicussion but there is not a good solution.

like image 451
Zeiga Avatar asked Nov 15 '22 04:11

Zeiga


1 Answers

The answer is given by Raymond Chen [1] and another Microsoft employee [2]; you have to remove the WS_EX_LAYOUTRTL style from the buttons in the window created by your CDialog (aka CPropertySheet). You can either do this globally when you create your CMainFrame and inherit it to all child windows, or locally by changing the window style from GWL_EXSTYLE.

[1] http://blogs.msdn.com/b/oldnewthing/archive/2010/06/11/10023274.aspx

[2] http://social.msdn.microsoft.com/Forums/en/vcgeneral/thread/057612e7-6cd4-44cf-a746-6370ace5de09

like image 160
user244795 Avatar answered Dec 12 '22 06:12

user244795