Determine if property exists at runtime?

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

Is there a clean way of determining if a propery exists in a form/class at
run time? I know I could do something like:

Try
If form/class_property=something Then
'Do exists processing
Else
'Do not exists processing
End if
Catch
End Try

But I am wondering if there is a certain property or something I can use to
check to see if another property exists.

Thanks.

Tom
 
You can do this with reflection. check this out in the Reflection namespace
 
* "Tom said:
Is there a clean way of determining if a propery exists in a form/class at
run time? I know I could do something like:

Try
If form/class_property=something Then
'Do exists processing
Else
'Do not exists processing
End if
Catch
End Try

But I am wondering if there is a certain property or something I can use to
check to see if another property exists.

\\\
If TypeOf x Is SomeType Then
DirectCast(x, SomeType).SomeProperty = 22
End If
///
 
Back
Top