?
Solved

Combo box in VC++ 6

Posted on 2003-02-21
4
Medium Priority
?
229 Views
Last Modified: 2010-04-17
i have addd combobox through wizard and attached combo varibale of control type with the combo box and in InitDialog added the following lnes
        combo.AddString("YES");
     combo.AddString("NO");
but the combobox dont show YES and NO when i execute the program?what is the mistake i am doing?


0
Comment
Question by:Zulqernain
3 Comments
 
LVL 2

Accepted Solution

by:
JoaTex earned 100 total points
ID: 7994295
Hi

Put a Command Button and a ComboBox in a form and try this Example: Then Adapted to your Program.

Code:
Option Explicit
Dim Test(3)
Dim n

Private Sub Command1_Click()
   For n = 0 To 2
      Combo1.AddItem Test(n)
   Next n
End Sub

Private Sub Form_Load()
   For n = 0 To 2
      Test(n) = "Test" & n + 1
   Next n
End Sub
Hope it suites you
Jo
0
 

Assisted Solution

by:jayesh_j_patel
jayesh_j_patel earned 100 total points
ID: 7995064
It should work fine if you have put
 AddString("YES");
after calling CDialog::OnInitDialog(); in OnInitDialog() function. What I think you have not dropped down(opened) combo to see the strings. To solve this problem you can call SetCurSel(0) to select the string.
Another way to add string is add it design time if you have fixed number of string to be displayed in the combo box. To add it design time right click on combobox and then select property and then data tab and type the strings you want to show.
Hope will solve your problem
Thanks,
Jayesh
0
 

Expert Comment

by:CleanupPing
ID: 9447589
Zulqernain:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Introduction to Processes

593 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