Solved

MFC ComboBox - getCurSel value changesbetween methods!

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
viewing source code from eclipse 13 110
wait notify demo infinite loop 3 125
matchUp  challenge 9 117
Problem to event 3 105
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

808 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