Having searched around a bit, I was not able to find anything on this matter. I would like to have the items in my listbox control (CListBox) to be center aligned, is this possible?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think your solution is going to have to be to derive your own class from CListBox and override OnMeasureItem and OnDrawItem to draw the items centered as you want. You’ll also have to make sure you create the listbox with a LBS_OWNERDRAWFIXED style.