|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
DropDownList BorderStyle conversion w/ OptionStrict ON
Hi, I have a DropDownList control that stores values from the BorderStyle enumeration. I want to take the selected value, and convert it back to a BorderStyle variable. But I have OptionStrict On, and it won't let me convert using the following ways:
Dim styleType As Type = GetType(BorderStyle) Label1.BorderStyle = [Enum].Parse(styleType, borderStyleList.SelectedItem.Text) or Label1.BorderStyle = borderStyleList.SelectIndex Why can't I do this? Is there another way to convert a selected item into the correct Type (BorderStyle, in this case) while OptionStrict is ON? It's so much easier in C#, using the casting: Label1.BorderStyle = (BorderStyle) borderStyleList.SelectIndex; Is there something in VB that's similar to the casting in C#? Thanks. |
|
#2
|
|||
|
|||
|
Sounds like a question for a VB.Net person (which I'm not, sorry).
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > DropDownList BorderStyle conversion w/ OptionStrict ON |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
![]() |
|