[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 181
  • Last Modified:

Is there a way to determine all of a class's methods?

I have a drop down box I would like to populate with the names of all methods in a public class. Is there a way to loop through a class's methods?
0
BASESLydia
Asked:
BASESLydia
1 Solution
 
Éric MoreauSenior .Net ConsultantCommented:
A hint: You need to use Reflection.
0
 
GlomCommented:
Hi !
Try this :

        Dim ObjectType As Type = GetType(**THE NAME OF YOUR CLASS **)
        Dim MI As Reflection.MethodInfo
        For Each MI In ObjectType.GetMethods()
            If MI.IsPublic Then
                CmbMethods.Items.Add(MI.Name)
            End If
        Next

Glom
0
 
BASESLydiaAuthor Commented:
Excellent! I appreacite the hint emoreau, but Glom's code works without me having to make any guesses!
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now