Solved

MFC ComboBox - getCurSel value changesbetween methods!

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
xyBalance chalenge 58 88
ASCII Non-Printable characters/codes and their HTML equivalents 6 95
sumNumber challenge 16 99
MaxSpan challenge 9 68
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 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

10 Experts available now in Live!

Get 1:1 Help Now