Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CComboBox alignment

Posted on 2000-03-10
7
Medium Priority
?
692 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 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

876 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