Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

removing sort in a listbox

Posted on 1998-07-02
3
Medium Priority
?
211 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
[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 Comments
 
LVL 7

Accepted Solution

by:
galkin earned 200 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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

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…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

721 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