Solved

Combox Box

Posted on 2004-03-28
2
241 Views
Last Modified: 2013-11-20
Hi all,

I have a CComboBox, I want to assign the item (others) selected from the combo box it will enable the edit box allow use to key in data.
Example:

ComboBox
---------
Adam
Bill
John
others

if user selected the second choice "others" thenit will enable the editbox
Please provide a *simple code*

Thanks
0
Comment
Question by:JerryGan9
2 Comments
 
LVL 19

Accepted Solution

by:
mrwad99 earned 20 total points
ID: 10698278
If you are doing this in a dialogue, add

CEdit m_wndEdit

to your dialogue class.

Then add

DDX_Control(pDX, <your edit box's ID>, m_wndEdit)

to your DoDataExchange function.

Then your code for enabling is

int nIndex = pmyComboBox->GetCurSel();
if (nIndex != LB_ERR && nIndex == 3) {
   m_wndEdit.EnableWindow(TRUE);
}

If your control is not in a dialog, disregard the DDX statement and the declaration of the edit box; it should have already been declared if you are doing this in your main window.

HTH
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 10701716
I have already told you how to do this in your other question
http://www.experts-exchange.com/Programming/Programming_Languages/MFC/Q_20923728.html
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

740 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