Solved

removing sort in a listbox

Posted on 1998-07-02
3
199 Views
Last Modified: 2013-11-19
How do you set the properties of a combo box so it does not sort the items which you add to it using the
AddString(..) function, but displays them in the drop-down list in the order by which you added them to the combo box?
0
Comment
Question by:nicholso
3 Comments
 
LVL 7

Accepted Solution

by:
galkin earned 50 total points
ID: 1318631
Remove CBS_SORT style from combo box with ModifyStyle(CBS_SORT, 0, 0);
0
 

Author Comment

by:nicholso
ID: 1318632
I already tried that and I can't get it to work... below is the code I'm trying but it doesn't
do it. The variable m_adaptationTypeCtrl is a CComboBox mapped to the control in the
dialog that I want to be non-sorted. ?

      m_adaptationTypeCtrl.ModifyStyle(CBS_SORT, 0, 0);
      UpdateData(false);

I don't understand why it isn't working, any help would be appreciated.

0
 
LVL 2

Expert Comment

by:jstolan
ID: 1318633
I seem to recall that although the sort style is removed, that internally the combo box does not change.  I think your answer is to create a new combo box without the sort property (in the same location as the first one), copy the strings in and destroy the original.  It's ugly I know, but I don't see another answer.
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
Shell script to login to remote m/c and execute commands 10 72
haveThree challenge 22 101
fix34  challenge 9 97
Making an alias 7 54
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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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 discusses moving either the default database or any database to a new volume.

746 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

12 Experts available now in Live!

Get 1:1 Help Now