Solved

CComboBox alignment

Posted on 2000-03-10
7
678 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 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
Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

 
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

Technology Partners: 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!

Question has a verified solution.

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

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 …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

630 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