Get Value Of Drop-Down List Box Using C#

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

--
susilo_saj
-----------------------------------------------------------------------
susilo_saja's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1591
View this thread: http://www.excelforum.com/showthread.php?threadid=27395

0
10/31/2004 9:27:06 AM
excel.misc 78881 articles. 5 followers. Follow

1 Replies
356 Views

Similar Articles

[PageSpeed] 58

"susilo_saja" <susilo_saja.1ezi3y@excelforum-nospam.com> schreef in bericht
news:susilo_saja.1ezi3y@excelforum-nospam.com...
>
> 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
>
>
> -- 
> susilo_saja
> ------------------------------------------------------------------------
> susilo_saja's Profile:
http://www.excelforum.com/member.php?action=getinfo&userid=15914
> View this thread: http://www.excelforum.com/showthread.php?threadid=273952
>

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.


0
tbot (20)
10/31/2004 11:57:21 PM
Reply:

Similar Artilces:

i get error 404 not found when trying to download
I'm trying to download nokia pc suite to windows xp to upload gallery onto the computer but get error message404 not found - how can i download this pc suite please -- Krysy Albutt Krysy Albutt wrote: > I'm trying to download nokia pc suite to windows xp to upload gallery > onto the computer but get error message404 not found - how can i > download this pc suite please Care to enlighten us how this pertains to: - 1) Microsoft 2) Publisher 3) Windows If you're having problems downloading from the *NOKIA* site where do you think you should be directing your ...

Using Outlook Custom Forms through OWA
Hi all, Is there any way to implement this? We have an Exchange 2003 server with Sp2. Users out of office hope to use outlook custom forms through OWA. Can this be done? ...

Target.Offset(0, 36).Value Help
In the below, I use this to force the persons USERNAME to populate 36 rows to the right in a column I hide. This shows me who was in a spreadsheet and updating ONE specific column... Column AD. My question is this... Can I poulate a named range with their USERNAME. I want to insert a named range, then force the USERNAME there. (INSERT>NAME>DEFINE>) Private Sub Worksheet_Change(ByVal Target As Excel.Range) Const myRange As String = "ad7:AD90" 'Const myrange As String = "A3,A6,A8,A11,A16" On Error GoTo stoppit Application.EnableEvents = False...

How to get Calendar to send me reminders
I have changed my e-mail address but for some reason I cannot get Calendar to send reminders to my new address - I think I have carried out all that is necessary to effect the changover but I am not getting reminders sent. Can anyone help please? Is the Calendar Live ID based and accessible at Calendar.live.com ? -- ....winston ms-mvp mail "Dabardevon" wrote in message = news:FDC2B3B2-EDE4-41B1-BFC4-C0F9ED59CFB9@microsoft.com... I have changed my e-mail address but for some reason I cannot get = Calendar to send reminders to my new address - I think I have...

How to return a range of values in a drop-down.
Is there a way to have Excel return a range of values in a drop down in one cell based on input from another cell. As an example: Cell A1 has the text "PVC Pipe" I want cell A2 to get input from A1, read through a table, and return the corresponding values (sizes) of PVC pipe. The results in A2 would be the following in a drop down: 4" 6" 8" If cell A1 contained the text "Metal Pipe" it would return values (sizes) of metal pipe from a table and not display the sizes of PVC pipe. 10" 12" 15" The bottom line and...

Colour values of calendar categories
Hi I'm trying to ensure appointments on our calendar are colour-coded by keywords. To keep track of which colour is assigned to which keyword, and so I can show others, I'm using Excel 2007. The problem is, I can't find anywhere that lists the rgb / hex value of the named colours (red, dark red, teal, maroon, etc). Please does anyone know where I can find these values, or better still, just let me know what they are? Thanks in advance Steve Years ago I had a tool that displayed the value for the color of where the mouse cursor was placed over. But I don'...

How to paint connections by value
Hi, Im doing rack diagram, so i need to paint all cables with different colors by their lengths. I can see all connections lengths from "size & position" one by one, How to do that? now looking up that "color by value" command and it doesn't work? Pls help? "Tulga" <tulgabat@gmail.com> wrote in message news:856c2ee0-0b04-48d0-9ad0-67791fd83b4e@w9g2000prb.googlegroups.com... > Hi, > > Im doing rack diagram, so i need to paint all cables with different > colors by their lengths. I can see all connections lengths from "...

Some recipients get the attachment, some get winmail.dat
This one has me baffled. We are using Exchange 2000 and Outlook 2000 and have been for 8 months. No previous problems with attachments (.doc, .xls, .jpg). About 2 weeks ago, we started hearing from certain recipients that the attachment wasn't arriving; instead they were getting an unreadable file called winmail.dat. MS says that this is because the sender is using Rich Text to format the email. We have changed the senders to use Plain Text and still have the same problem. If the email is sent to several recipients, some will get the attachment fine, some will not. This didn'...

AutoArchive using VBA CDO CdoPR_AGING_PATH
I am trying to programatically change the path to the archive file. My pst has may folders and I dont want to change the path on each one by hand. Using the code I can change the GRANULARITY and the PERIOD but the path wont change. ( I am verifying the settings by right clicking the folder and selecting AutoArchive). I have tested in both Outlook 2002 and 2003. On 2003 I was able to change the path when I ran the code the first time but subsequent attempt failed to change the path. Strangely when I view the path (objMessage.Fields.Item(CdoPR_AGING_PATH).Value) via code after I change it, i...

Tax Value Not Transferring
We currently have our salespeople working in orders, and once the order is complete, we transfer it to an invoice. When we perform these transfers, if there is any value entered in the Tax field, this value is not transferred onto the invoice. We always check the box labeled "Include Totals and Deposits," but that doesn't seem to do the trick. Also, we noticed that whenever the shipping method on an invoice is changed, the value in the tax field changes to 0. Is there any way to prevent either of these things from happening? ...

How to get the CScrollBar's Handle in CTreeCtrl?
Hey,All: I thought I have a problem when I trid to get the CScrollBar's handle from my CTreeCtrl extended handle. Can anybody tell me whether I can get the handle of the CScrollBar from the CTreeCtrl? Thanks in advance! Carl :-| Carl wrote: > Hey,All: > > I thought I have a problem when I trid to get the CScrollBar's handle from > my CTreeCtrl extended handle. > Can anybody tell me whether I can get the handle of the CScrollBar from the > CTreeCtrl? > > Thanks in advance! > Carl > :-| > > Sorry, it is not that simple. The scroll bars that...

numbering multilevel list word 2007
trying to use a multilevel number list and when I hit ENTER (return) the numbering stops (the icon for numbering become un-highlighted) If this is numbering attached to headings, note that, by default, the Normal style will be applied to text when you press Enter (at the end of a heading). You can change the "Style for following paragraph" in the style definition for the relevant heading(s). -- Stefan Blom Microsoft Word MVP "dheuermann" <dheuermann@discussions.microsoft.com> wrote in message news:EEF7E0F7-76A1-4B55-98B3-981E303C7A68@microsoft.co...

Likert scale calculation
I have used the following table in my survey: Frequency of use - check which on is applicable: every few hours every few mins every few secs item1 item2 item3 .. .. .. item10 so the sample data looks like this: id item1 item 2 ............. item10 1 hours hrs ................. mins 2 secs hrs ................. mins 3 mins hrs ................. mins I want to add up the hours secs mins for each item..for example (from the above sample): ev...

A Crystal Beginner
I am using Crystal 9.2.4.77 and have loaded the Crystal enhancements. Now I want to do against the CRM database. What do I do? I thought I would create a data source to the CRM SQLserver, which I did, then connect to it through Crystal Reports. That works, but when I drill down on the AAA_MSCRM database to choose my tables, it shows me dbo as the only option (where did this come from??) and under that are just a few generic tables. No CRM tables. Something's not quite right. What am I missing? file - log on to aps server "KBLawson" <klawson@aetinc.com> wrote in ...

sort by subtotal values
When I use the insert subtotals, I would like to sort by those subtotals. It is not sorting them properly. What do I need to do first before I tell it to sort. Thanks so much If you have one level of subtotals, you can collapse the table, so only the subtotals are visible. Then, select a cell in the column that you want to sort, and click the A-Z or Z-A button on the toolbar. harry wrote: > When I use the insert subtotals, I would like to sort by > those subtotals. It is not sorting them properly. What > do I need to do first before I tell it to sort. -- Debra Dalgleish...

Cannot get fast forward or fast reverse to work with WMP 11
I am running Vista Home Premium on a HP G 217-EM Notebook which comes pre-installed with Windows Media Player 11. When I play cds and try to fast forward or fast reverse by keeping the fast forward or fast reverse buttons constantly depressed nothing happens. Why is this, and can anyone come up with a solution? Many thanks This doesn't work on my system either, so it's probably just a limitation of WMP. Fast forward and fast reverse should work fine when you rip the CD's to MP3 or WMA files, and play these files instead. Regards -- Tim De Baets http://www....

Combo Box Yes/No error
Hello. I have a form that I want to add a function in the footer that will allow me to sort the records based on whether they are active or inactive. The field in my table is a yes/no check box that is check for yes and unchecked for no. I have tried to use a combo box with 2 columns, Active and Inactive with corresponding fields yes/no check boxes. I set it up as a 2 column count combo box and hid the yes/no column so active/inactive would appear. I get an error that the expression is too complex.... The information is passed to my query to the Active Yes/No column by using: [Forms]![E...

Get paid while you get online!!
I found a great Internet company - Cashfiesta.com - that has created a product everyone can benefit from. They pay you while you work or play on your computer. All you need to do is keep their software - the FiestaBar=99 - active while you are online. They even pay you when your friends are using their computers. Unlike other companies, Cashfiesta gives you control over how much money you earn. They have an individual payrate based on the number of Special Offers you sign up for. As some of these offers are free, you can increase your payrate up to 33 times without spending a penny. It's...

Add new record using first available non-numeric ID; update two ta
Access 2003, Windows XP Pro SP2 I have two tables, tblDed and tblVendor. tblDed contains two columns (DedID and Avail). The first column contains a list of all DedIDs allowed to be used. The second is a Yes/No choice indicating whether or not that DedID has been used already. tblVendor contains multiple columns with misc. data relevant to the Vendor. I want to create a form that will accomplish three things: 1. Use the next available unused DedID when a command button on a referring menu page (frmMenu, btnNew) is pressed. 2. Mark the now-used DedID in tblDed as "No" - no ...

Excel opens correct view
I get excel all set up with a freeze pane showing about half the columns ( also just hid the unnecessary columns) and save it and when I open it - its just like i saved it - Great!. Then I publish it in Frontpage and it opens in preview or with IE on the web showing every column I hid. So when it opens with excel or explore - Great - when it gets published it opens differently exposing all the hidden columns. How do i fix this - big sheet is not acceptable to client. Jim2003 Try selecting the entire workbook and copy/pasting special (values), then delete the rows you don't need t...

Distribution List permissions #2
Exchange 2003 in native mode. How do I protect a DL so that only certain IT personnel can add/remove members to this DL? There seems to be someone that has permissions to modify some of the DLs in our environment and I need to prevent that from happening. Thanks. Distribution Groups are AD objects and have permissions/ACLs just like any other AD object. Modify the permissions to restrict who has rights to change it. -- Bharat Suneja MVP - Exchange www.zenprise.com NEW blog location: www.exchangepedia.com/blog ---------------------------------------------- "Edward" <Edwa...

Inability to chart a logartihmic values
I have been working on some mathematical formulas and equations and am trying to chart them. However I need to be able to have a logarithmic axis for one set of the values and do not know how to obtain this. Any help would be greatly appreciated. To get a log scale, double click on an axis, click on the Scale tab of the Format Axis dialog that pops up, and check the Logarithmic Scale box. If you want to make the X axis into a log scale, make sure you have a scatter chart, not a line chart. The line chart treats the X values as nonnumeric categories, while the scatter chart treats them as ...

Can't get auto-update (update) to install
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: Power PC I've been trying to manually check for updates to Word 2008, and I get a &quot;critical update&quot; notice, asking me to install auto-update. When I try to install it, I cannot. It just keeps repeating the attempt, in an &quot;endless loop.&quot; What to do? <br> Thank you. ...

Check Box Grouping
Hello, When I group on a check box field, I get duplicate records. Would anyone know why this would happen? Ellen What happens if you change your Grouping and Sorting expression to: =IIf([YourYNFieldName],"A","B") -- Duane Hookom Microsoft Access MVP "EllenM" wrote: > Hello, > When I group on a check box field, I get duplicate records. Would anyone > know why this would happen? > > Ellen Why would you group on a check box? I would think you would apply criteria only to get either Yes or No's. Post your que...

using the $ to lock formulas
We are using the $ to lock the formula but when columns are inserted the formula still changes. How do we correct this? Thank you for any assistance you can give. Hi one way would be to use something like INDIRECT("A1") to always refer to cell A1. Note: copying this formula won't change the cell reference -- Regards Frank Kabel Frankfurt, Germany frankmlr wrote: > We are using the $ to lock the formula but when columns > are inserted the formula still changes. How do we correct > this? > > > Thank you for any assistance you can give. One way: =I...