I'm trying to create a dynamic dialog, which can be made RTL depending on the language. But I have the following issue: whenever I change the RTL style of the combo box, the text comes up reversed. I tried using functions such as InvalidateRect
, RedrawWindow
, etc., but couldn't make it work correctly.
Relevant code (WinAPI with WTL):
CComboBox combo = hWndCtl;
if(combo.GetCurSel() == 0)
combo.ModifyStyleEx(WS_EX_LAYOUTRTL, 0);
else
combo.ModifyStyleEx(0, WS_EX_LAYOUTRTL);
A demo project: here.
A demonstration of the issue: