02-14-2012 03:52 AM
Hi,
Is it possible to the change the text justification in a list box ? to right or center for example ?
in the control i can't change it....
02-14-2012 04:01 AM - edited 02-14-2012 04:01 AM
You can change the text alignment of a listbox both in the UIR editor and programmatically. While editing listbox properties in the UIR editor use Text style... button to display the Edit text attributes dialog box where you can set the desired text alignment. In code, you can use SetCtrlAttribute with ATTR_TEXT_JUSTIFY attribute.
Both methods affect the whole control aspect, i.e. is not possible to have part of text in a textbox left justified and some other text right justified.
02-14-2012 04:06 AM
Hi Roberto,
I'm attaching a pic.....
as you can see I can't select the justefiction it's dimmed.
02-14-2012 04:33 AM
I am sorry: I made a confusion between a listbox and a textbox
A listbox is natively left justified and you cannot change this in the UIR editor. You can apply the appropriate justification elements while creating the string to pass to the listbox: see the online help for Item Label parameter in InsertListItem function. All escape codes are to be applied to every line you insert into the listbox: there is no way to apply a default formatting style to the control.
02-14-2012 05:44 AM
Thanks Roberto
those are very nice options witch can be very useful ! 🙂
02-14-2012 10:10 AM
Another possibility is you could try using a table with only one column visible and set the justification of all the cells to VAL_CENTER_RIGHT_JUSTIFIED.