Solved

Combox Box

Posted on 2004-03-28
2
243 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
[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 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Perl Awk Need Help 3 150
List out all word 7 359
post4 challenge 28 122
Modbus - whats the maximum I can store in one register? 4 85
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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…
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.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

752 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