Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. TabControl and GetType()

TabControl and GetType()

Scheduled Pinned Locked Moved C#
data-structureshelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zaboboa
    wrote on last edited by
    #1

    Hi, I am trying to get the FieldInfo for my TabControl. In particular I am interested in EVENT_SELECTEDINDEXCHANGED. I have method to which I am passing my TabControl object, and it's a "target" variable.

    targetType = target.GetType();
    FieldInfo[] fields = targetType.GetFields(BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic);

    Now I am trying to see if any of the fields in the fieldinfo array contains EVENT_SELECTEDINDEXCHANGED. Any help is appreciated. Thank you

    W 1 Reply Last reply
    0
    • Z zaboboa

      Hi, I am trying to get the FieldInfo for my TabControl. In particular I am interested in EVENT_SELECTEDINDEXCHANGED. I have method to which I am passing my TabControl object, and it's a "target" variable.

      targetType = target.GetType();
      FieldInfo[] fields = targetType.GetFields(BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic);

      Now I am trying to see if any of the fields in the fieldinfo array contains EVENT_SELECTEDINDEXCHANGED. Any help is appreciated. Thank you

      W Offline
      W Offline
      Wendelius
      wrote on last edited by
      #2

      SelectedIndexChanged is an event, not a field. So if you're trying to get info about it using reflection, use GetEvents-method (or if you already know the event, GetEvent)instead of GetFields.

      The need to optimize rises from a bad design. My articles[^]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups