Solved

Combox Box

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

910 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

22 Experts available now in Live!

Get 1:1 Help Now