Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to check form existence of a method
Message
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00745631
Message ID:
00746085
Views:
18
Thanks, Cathy, the MethodInfo object worked like a charm. I also needed to verify an object property, so I tried "Dim memInfo as PropertyInfo ..." and it worked as well. I guess that's why a standardized naming convention is valuable.

Thanks again.

>Hi Don,
>
>You can use the GetMethod method of the Type class to see if a method exists. Here is some sample code:
>
>
>Dim typ As System.Type = GetType(MyClass)
>Dim memInfo As MethodInfo= typ.GetMethod("MyMethod",BindingFlags.NonPublic Or BindingFlags.Instance Or BindingFlags.Static Or BindingFlags.Public)
>If memInfo Is Nothing
>   ' Method NOT found
>End If
>
>
>>Can anyone give me advice on how to check for the existence of a method in an object before calling it in VB.Net? In VFP I use a call to PEMSTATUS(), but haven't found an equivalent in VB.Net.
Previous
Reply
Map
View

Click here to load this message in the networking platform