Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
a pic of my program with result here :
http://im72.gulfup.com/xCvXo2.png
i expected in my program i will get the result as
comboBox1 a
comboBox2 b
comboBox3 c

but i got the result reversed !!

if any body have a solution , then help me :)
Posted
Updated 30-Apr-14 1:13am
v2
Comments
DaveAuld 30-Apr-14 7:11am    
Where is the code you have written to generate the problem?
Hamdi Choban 30-Apr-14 7:15am    
i edited my question , i added a link to the picture of my code and result
CHill60 30-Apr-14 7:15am    
No ... post your code here. Many of us cannot link to sites like that when we're at work - they're blocked (for good reason)
Hamdi Choban 30-Apr-14 7:21am    
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

ListBox1.Items.Clear()
For Each combo As Control In Me.GroupBox1.Controls
If TypeOf combo Is ComboBox Then
ListBox1.Items.Add(combo.Name + " " + combo.Text)
End If
Next
End Sub


:::: in my program i have 3 comboBoxes inside a groupBox , a listBox , and a button .. After selecting contents for every comboBox then i press the button .. i want to get in my listBox a result as [ comboBoxName+comboBoxContenet ] as
comboBox1 a
comboBox2 b
comboBox3 c

but i got

comboBox3 c
comboBox2 b
comboBox1 a

. this is my problem

1 solution

Ok ... you can't sort the order that the controls are presented to you (AFAIK) but you could sort the list box ... Set the sorted property to true
 
Share this answer
 
Comments
Hamdi Choban 30-Apr-14 7:27am    
thanks CHill60 , your answer was helpful :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900