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. usercontrol and control and form events

usercontrol and control and form events

Scheduled Pinned Locked Moved C#
javascriptcomhelptutorial
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.
  • M Offline
    M Offline
    Marcel Vreuls www agentbase nl
    wrote on last edited by
    #1

    Hi Everybody, I have a problem (for me than :-) that i do not now how to do the following. I have a usercontrol with on it a listview control. This usercontrol is placed on a standard winform. Now i want on the form react on a event of the listview control. In other words. I the listview is clicked i want to catch the event en do something with the selected record. I can set the on click event in the usercontrol but that will not show up in my form. I have tried something with override on click events but cannot get the hang of it. Any examples, suggestions. Thanks

    Kind regards, Marcel Vreuls http://www.marcelvreuls.com <<A good idea can change your life>>

    S 1 Reply Last reply
    0
    • M Marcel Vreuls www agentbase nl

      Hi Everybody, I have a problem (for me than :-) that i do not now how to do the following. I have a usercontrol with on it a listview control. This usercontrol is placed on a standard winform. Now i want on the form react on a event of the listview control. In other words. I the listview is clicked i want to catch the event en do something with the selected record. I can set the on click event in the usercontrol but that will not show up in my form. I have tried something with override on click events but cannot get the hang of it. Any examples, suggestions. Thanks

      Kind regards, Marcel Vreuls http://www.marcelvreuls.com <<A good idea can change your life>>

      S Offline
      S Offline
      sunspeed
      wrote on last edited by
      #2

      Hy, I have a usercontrol with on it a listview control. This usercontrol is placed on a standard winform. Now i want on the form react on a event of the listview control. In other words. I the listview is clicked i want to catch the event en do something with the selected record. Why would you react in your Form? Handle the Events in your Usercontrol. I can set the on click event in the usercontrol but that will not show up in my form. I have tried something with override on click events but cannot get the hang of it. The event will be fired, if the usercontrol itself is clicked for example. If you want to catch the event on the listview, you have to publish an event for that in your usercontrol and forward the onclick event of your ListView. For Example: MyUserControl.OnListViewClicked += new someeventhandler(handler) Hope this helps

      Der Staat mit der niedrigsten Geburtenrate ist nicht die Bundesrepublik, sondern der Vatikan.

      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