Solved

Combox Box

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

 Watch the Recording: Learning MySQL 5.7

MySQL 5.7 has a lot of new features. If you've dabbled with an older version of MySQL, it is definitely worth learning.

Question has a verified solution.

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

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‚Ķ
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.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

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