Combo String

Posted on 1999-01-21
Last Modified: 2013-11-20
How can I get the visible String (ie the String I selected)
from a ComboBox?
Question by:matchz
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

Accepted Solution

jrmcg earned 50 total points
ID: 1328135
// this will retrieve the text at the given index.
CString strValue;
int index;

// CboBox is a control variable assigned to your CComboBox control

index = CboBox.GetCurSel();
CboBox.GetLBText(index, strValue);

if you want the text as soon as the item is selected use the

message and use the code above.

If you need any further help with it let me know...

Author Comment

ID: 1328136
Thx, Exactly what I want.

Expert Comment

ID: 1328137
Glad I could help..


Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

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.
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