User Control Events

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • romepatel
    New Member
    • Nov 2009
    • 31

    #1

    User Control Events

    Hi,

    I am working on Windows Form.

    I have a user control, which has an Image(PictureBo x) and a label.


    Now When i am using it on the form and i have attached an click event on the user control.

    When i click on the control the click event works fine, but when i click on the image or label inside the user control, it calls the events of the image and label respectively. But i don't want to call the click event of the image or label, i want to call the event which i written for the usercontrol on the form (not at the usercontrol creation).

    How do i do this. ?
    Please help.
  • romepatel
    New Member
    • Nov 2009
    • 31

    #2
    Hi,

    It got solved by adding

    private void img_Click(objec t sender, EventArgs e)
    {
    base.OnClick(e) ;
    }

    Comment

    Working...