Solved

Combox Box

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

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

11 Experts available now in Live!

Get 1:1 Help Now