Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 132,324 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,101 people online right now. Registration is fast and FREE... Join Now!




choose between the ComboBox values

 
Reply to this topicStart new topic

choose between the ComboBox values

alowais
post 1 Oct, 2008 - 05:01 AM
Post #1


New D.I.C Head

*
Joined: 13 Sep, 2008
Posts: 26

Hi guys,
i've combo box contain collection of values for example 1,2,3,4,5
OK ,what i need to do is when the value 1 chose what should display upon that choose..
in other word i want to show somthing when a value have been chosen from the box........HOW?
User is offlineProfile CardPM

Go to the top of the page

eclipsed4utoo
post 1 Oct, 2008 - 05:05 AM
Post #2


D.I.C Regular

Group Icon
Joined: 21 Mar, 2008
Posts: 314



Thanked 17 times

Dream Kudos: 25
My Contributions


take a look at the "SelectedIndexChanged" event for the combo box
User is offlineProfile CardPM

Go to the top of the page

alowais
post 1 Oct, 2008 - 05:43 AM
Post #3


New D.I.C Head

*
Joined: 13 Sep, 2008
Posts: 26

QUOTE(eclipsed4utoo @ 1 Oct, 2008 - 06:05 AM) *

take a look at the "SelectedIndexChanged" event for the combo box


It's good idea but still not helpfull , thank you anayway
User is offlineProfile CardPM

Go to the top of the page

eclipsed4utoo
post 1 Oct, 2008 - 06:39 AM
Post #4


D.I.C Regular

Group Icon
Joined: 21 Mar, 2008
Posts: 314



Thanked 17 times

Dream Kudos: 25
My Contributions


you want a full code example?
User is offlineProfile CardPM

Go to the top of the page

eclipsed4utoo
post 1 Oct, 2008 - 06:47 AM
Post #5


D.I.C Regular

Group Icon
Joined: 21 Mar, 2008
Posts: 314



Thanked 17 times

Dream Kudos: 25
My Contributions


how about "SelectedValueChanged" event? I am sure that will work for you.
User is offlineProfile CardPM

Go to the top of the page

alowais
post 4 Oct, 2008 - 09:46 AM
Post #6


New D.I.C Head

*
Joined: 13 Sep, 2008
Posts: 26

QUOTE(eclipsed4utoo @ 1 Oct, 2008 - 07:47 AM) *

how about "SelectedValueChanged" event? I am sure that will work for you.




Man that's perfect ,
but do u know how to speicfy the message for each value in the box?
because this is will work on all of it ..

thank you veru much ma man, biggrin.gif
User is offlineProfile CardPM

Go to the top of the page

eclipsed4utoo
post 4 Oct, 2008 - 03:50 PM
Post #7


D.I.C Regular

Group Icon
Joined: 21 Mar, 2008
Posts: 314



Thanked 17 times

Dream Kudos: 25
My Contributions


QUOTE(alowais @ 4 Oct, 2008 - 01:46 PM) *

QUOTE(eclipsed4utoo @ 1 Oct, 2008 - 07:47 AM) *

how about "SelectedValueChanged" event? I am sure that will work for you.




Man that's perfect ,
but do u know how to speicfy the message for each value in the box?
because this is will work on all of it ..

thank you veru much ma man, biggrin.gif


I am not understanding the "how to specify the message for each value" of your question. Please explain.
User is offlineProfile CardPM

Go to the top of the page

alowais
post 5 Oct, 2008 - 09:14 PM
Post #8


New D.I.C Head

*
Joined: 13 Sep, 2008
Posts: 26

let us say for example you're doing flight reservation system and each flight have different price so when you select flight from NY to LA it would have different price than the other destination,

i hope it's clear now and thanks
User is offlineProfile CardPM

Go to the top of the page

eclipsed4utoo
post 6 Oct, 2008 - 05:11 AM
Post #9


D.I.C Regular

Group Icon
Joined: 21 Mar, 2008
Posts: 314



Thanked 17 times

Dream Kudos: 25
My Contributions


where would you be getting this price from? a database? a text file? stored in a list that is currently in memory?

You can use the "SelectedValueChanged" event for the combobox. in the event, you can get the value that was chosen by using this code:

csharp

string userSelection = comboBox1.Text;


this will give you the text that the user is looking at when they select a value from the list.

now you just use that value to determine what other information you want to display.
User is offlineProfile CardPM

Go to the top of the page

alowais
post 6 Oct, 2008 - 06:06 AM
Post #10


New D.I.C Head

*
Joined: 13 Sep, 2008
Posts: 26

okkkkk

thanks alot now i think can solve it..
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/22/08 02:42AM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month