?
Solved

Combo box in VC++ 6

Posted on 2003-02-21
4
Medium Priority
?
224 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
[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
4 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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.
Make the most of your online learning experience.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Six Sigma Control Plans

765 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