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