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. How to add event handlers for controls added at runtime.

How to add event handlers for controls added at runtime.

Scheduled Pinned Locked Moved C#
csharptutorial
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.
  • H Offline
    H Offline
    Herhighness
    wrote on last edited by
    #1

    I am using a third party SNMP component. I create this component at run-time in a C# class. I am wondering if there is someway I can use event handlers for this control in that class.

    K 1 Reply Last reply
    0
    • H Herhighness

      I am using a third party SNMP component. I create this component at run-time in a C# class. I am wondering if there is someway I can use event handlers for this control in that class.

      K Offline
      K Offline
      KrIstOfK
      wrote on last edited by
      #2

      Your thrid party component has to trigger events, once you know it does, you can catch them by for example with a button: btnButton.Click += (and then you press tab and it will create the method for you) When the third party component doens not trigger any events i'm affraid you can't. You can recognize events when you press . and then you get a list of all posible options, when it's a yellow lightening sign it's an event. (this if you use Visual Studio)

      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