Solved

MFC ComboBox - getCurSel value changesbetween methods!

Posted on 2007-03-24
3
2,626 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
  • 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 250 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Show shut-down message as Windows 8 shuts down. 9 85
Need to retreive data from .TFS file exported by DVR 8 177
Define unique primary key 9 89
matchUp  challenge 6 52
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

919 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

16 Experts available now in Live!

Get 1:1 Help Now