Solved

CComboBox alignment

Posted on 2000-03-10
7
645 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
  • 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 25 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ADO Memory leak with DELPHI 2007 37 155
substring method in java 1 79
bigDiff challenge 17 75
Fibonacci challenge 11 82
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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 video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

705 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now