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

x
?
Solved

MFC ComboBox - getCurSel value changesbetween methods!

Posted on 2007-03-24
3
Medium Priority
?
2,635 Views
Last Modified: 2013-11-20
Hello,
I have the following combobox & MFC related  prob/qs!:

I have a combobox control with 3 values. the combobox control is called cmbSearch. THe code I have to add strings to the comboBox is :

cmbSearch.AddString("Load Number");
            cmbSearch.AddString("Tractor Number");
            cmbSearch.AddString("Terminal Number");

But in the comboBox it shows u pwith Terminal number as the second string. How do I correct this?

Thanks in advance,
-Dee
0
Comment
Question by:indacrypt
[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
  • 2
3 Comments
 

Author Comment

by:indacrypt
ID: 18787371
Also in the same program , I have an edit control with which Ihave associated an integer variable (tEdit_select). But no matter what value i enter when I run the code, its always 0 when I look at whats going on in debug mode....any ideas on how to fix that as well?
Thanks!
-D
0
 
LVL 5

Accepted Solution

by:
bastibartel earned 1000 total points
ID: 18788149
Hello Dee,

The listbox sorts the strings by default. Go to the resource editor and open the listbox properties (rclick).
On the 2nd tab (I believe) there is a checkbox to enable/disable sorting of string items.

On the second question:
Do you ever call UpdateData(TRUE) after entering anything into the edit box ?

Cheers,
Sebastian
0
 

Author Comment

by:indacrypt
ID: 18788682
Yep! that works. Thanks:)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

730 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