Solved

CComboBox alignment

Posted on 2000-03-10
7
659 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying 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

Suggested Solutions

Title # Comments Views Activity
has22 challenge 11 105
NotAlone Challenge 20 85
JQuery serialize and unserialize 8 138
Work with App store 7 68
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

830 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