Reputation: 50768
While doing localisation of dialogs in an .rc file I came upon following difference in the definition of a right aligned static control:
DIALOGEX
is defined like this:LTEXT "some text",IDC_STATIC,14,24,17,8,0,WS_EX_RIGHT
RTEXT "some translated text",IDC_STATIC,14,24,17,8,0
With both resource files the text is displayed right aligned as expected.
Is there a difference between both ways? Or is LTEXT
with WS_EX_RIGHT
just another way than RTEXT
for displaying right aligned text?
I use the current version of Visual Studio 2022.
Actually there seems to be some redundancy. In the resource editor the Align Text property controls whether you get RTEXT
, CTEXT
or LTEXT
and the Right Align Text property controls the presence of the WS_EX_RIGHT
style.
Upvotes: 0
Views: 116
Reputation: 2130
According to LTEXT
control, CTEXT
control and RTEXT
control, they have SS_LEFT
, SS_CENTER
and SS_RIGHT
respectively.
And according to WS_EX_RIGHT
,
Constant/value | Description |
---|---|
WS_EX_RIGHT 0x00001000L | The window has generic "right-aligned" properties. This depends on the window class. This style has an effect only if the shell language is Hebrew, Arabic, or another language that supports reading-order alignment; otherwise, the style is ignored. Using the WS_EX_RIGHT style for static or edit controls has the same effect as using the SS_RIGHT or ES_RIGHT style, respectively. Using this style with button controls has the same effect as using BS_RIGHT and BS_RIGHTBUTTON styles. |
Upvotes: 0