is there any method available for change the property "right align text" of CListBox in MFC(c++)?

386 Views Asked by At

I am working on Microsoft Foundation Class (c++)chat application in which i want to show client message on right side of the list box,There is a property available "Right align text" but i want to do it by method. because default Left side text is also necessary for me.

Thank You.

1

There are 1 best solutions below

0
snowdude On BEST ANSWER

Use ModifyStyleEx to add/remove the extended style WS_EX_RIGHT as required, e.g. to right-align:

GetDlgItem(IDC_LIST1)->ModifyStyleEx(NULL, WS_EX_RIGHT);