Solved

Using a combobox C++

Posted on 2006-07-18
7
1,161 Views
Last Modified: 2008-01-09
I have an assignment for uni. I'm to create an app that shows a shape selected from list within a combo box.

I have entered the

following items in the OptionComboBox

Square
Circle
Triangle

My overall design was

OnChange
if selection = square then
   displaysqaure
else
   if selection = circle then
       display circle
   else
       if selcetion = triangle then
            display triangle
       else don nothing

Guidance on how to use the combo box and it events would be great.

Thanks

St

Stefan
0
Comment
Question by:Levi101
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 17130028
The code you've posted above bears little resemblance to C++.  Are you programming in C++ or some other language?
0
 
LVL 1

Author Comment

by:Levi101
ID: 17130677
Sorry it is C++
0
 
LVL 32

Expert Comment

by:jhance
ID: 17132452
In that case I think you need to work on this a bit more yourself.  The Experts Exchange site policy prohibits experts from doing your homework for you.  It's one thing to say, "please look at what I've done and help me figure out why it does this vs. what it's supposed to do."  But you're basically saying, "I haven't really done anything, please do it for me..."  That's not what this site is about.
0
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.

 
LVL 7

Expert Comment

by:yotamsher
ID: 17132968
Hey  Levi101

jhance has a point.
but still if you need a jump start, and as I suspect this combo box, is not the heart of the project, I will try to assist:
1) first what OS are you using? (your pseudo code smells like VB which is a hint towards windows, but it is not clear)
2) if the OS is clear, are you using any GUI library ?(MFC, ATL, DotNet windows forms etc.)

answer those, and you'll get the start point for your project
0
 
LVL 1

Author Comment

by:Levi101
ID: 17134323
Jhance
I'm not asking you to do my homework, I am simple asking for guidance on how to use the Onchange property of the combobox. I could use buttons or even a menu. However i feel it's cleaner if i use a combobox. I have refered the borland help and draw a blank. If it makes you feel any better the the bit I'm strugling with is the variable selction ie.
if user selects options one, where is the variable and how do I use it eg if (SelctionV = OptionCombo->item->Option 1);

yotamaster
I'm using borland C++ and its libaries, the OS is windows.
0
 
LVL 7

Accepted Solution

by:
yotamsher earned 500 total points
ID: 17136275
Hey Levi101

I think your syntax will be something of the form:

ShapeString = ComboBox1->Items->Strings[ComboBox1->ItemIndex];
0
 
LVL 1

Expert Comment

by:yogesh28577
ID: 17173878
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

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

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

24 Experts available now in Live!

Get 1:1 Help Now