Hmmmm, which reminds me - a while back someone posted a website where you
could get a complete list of all exception classes that can be thrown by
components (eg. ArgumentOutOfRangeException), along with a details of where
you should use them. Can anyone reccie this and post a link?
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:u3**************@TK2MSFTNGP10.phx.gbl...
Peter,
In addition to the other comments, you can use Enum.IsDefined to ensure
that
the Textbox's value is a value Enum1 value.
Something like:
If Not [Enum].IsDefined(GetType(enum1), textbox1.text) Then
Throw New ArgumentOutOfRangeException("TextBox1.Text",
textbox1.text, "Invalid enum1 value")
End If
Hope this helps
Jay
"Peter Stojkovic" <Pe*************@gmx.net> wrote in message
news:uA**************@TK2MSFTNGP14.phx.gbl...
|I have an ENUM
|
| Public Enum enum1 As Integer
| STEP_00= 0
| STEP_01= 1
| STEP_02=2
| ....
| STEP_999=999
| end enum
|
| When the user makes an input like 99
|
| the variable xx should be set.
|
| Dim xx as enum1
| xx = cint(textbox1.text)
|
| But Cint is not possible. How can I assign the user-input ( for example
99 )
| to varibale xx ??
|
|
|
| Thanks for any help
|
|
|
|
|
|
|
|
|
|