Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CComboBox alignment

Posted on 2000-03-10
7
Medium Priority
?
686 Views
Last Modified: 2013-11-20
Hi!

I'm trying to right align text in a combo box.  The checkbox in the properties doesnt seem to change anything at all.

Is it possible to change the alignment of the text?
0
Comment
Question by:asavard
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 11

Expert Comment

by:mikeblas
ID: 2606291
You'll have to go owner-draw. The right-align style is for localized versions of Windows which support bidirectional languages.

..B ekiM
0
 
LVL 11

Accepted Solution

by:
mikeblas earned 75 total points
ID: 2606293
You'll have to go owner-draw. The right-align style is for localized versions of Windows which support bidirectional languages.

..B ekiM
0
 

Author Comment

by:asavard
ID: 2606317
Yet another dumb restriction!

Oh well!

Thanks
:)

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Expert Comment

by:mnewton022700
ID: 2606323
You can do this without using owner-draw.

In your dialog class you will need to get a pointer to the comboBox. You can use CWnd::GetDlgItem to do this.

Then use CWnd::ModifyStyleEx to change the justification.

    CWnd * pComboBox = this->GetDlgItem(COMBOBOX_ID);

    pComboBox->ModifyStyleEx(0,WS_EX_RIGHT);

This will right align all the text in the box.
0
 
LVL 3

Expert Comment

by:mnewton022700
ID: 2608450
I have tested the code in my above comment and it works fine. I'm sure that MikeBlas is very seldom wrong, but I think on this occasion that he is.

I do not have a localised version of Windows.

I'm not going for points here, this is just fyi.

0
 

Author Comment

by:asavard
ID: 2612219
I wish you were right mnewton, but for some reason you are not.  I tried what you said above, text is still aligned on the left side of the box.

No biggie.

Thanks
0
 
LVL 3

Expert Comment

by:mnewton022700
ID: 2613833
Very strange, it definitely works for me.

Oh well, whatever.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question