Solved

MFC ComboBox - getCurSel value changesbetween methods!

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

Three Considerations for Containers

Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read our article on Experts Exchange.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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…
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.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

623 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