Get Value Of Drop-Down List Box Using C#

S

susilo_saja

Get Value Of Drop-Down List Box

--------------------------------------------------------------------------------

Hi,

I'm not sure whether to ask this question in C# Forum or Excel Forum

I've asked this on a C# forum but hasn't got reply.

My task is to read an excel file using C# ,
and get the selected item of a Drop-down List Box.
Can someone help me with this ?

Another question is , can I have a value for each item in a drop-dow
list box , beside the text that was shown ?
What I mean is like in HTML , we can have "value" attribute for eac
"<option>" tag , beside the text that was shown to the user .

Regards,
Susil
 
M

merlin

susilo_saja said:
Get Value Of Drop-Down List Box

-------------------------------------------------------------------------- ------

Hi,

I'm not sure whether to ask this question in C# Forum or Excel Forum .

I've asked this on a C# forum but hasn't got reply.

My task is to read an excel file using C# ,
and get the selected item of a Drop-down List Box.
Can someone help me with this ?

Another question is , can I have a value for each item in a drop-down
list box , beside the text that was shown ?
What I mean is like in HTML , we can have "value" attribute for each
"<option>" tag , beside the text that was shown to the user .

Regards,
Susilo

It's possible in C++, so I guess C# will do too.

To get the selected dropdown item, use i.e. vbCmbBox.ListIndex
Like in JavaScript, the first item is 0, and a NULL option will give you -1.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top