locked
user Control default event RRS feed

  • Question

  • hi

    I have created a userControl. is it possible to set an event as a default event. because when I double click on my control, default event is Control_Load and I want to change it to something else like double click or click.

     

    Monday, December 18, 2006 12:36 PM

Answers

  • Hi,

    use DefaultEvent attribute on a class level to set usercontrol's default event:

    [DefaultEvent("KeyPress")]
    public partial class UserControl1 : UserControl
    {
        ...

    Andrej

    Monday, December 18, 2006 1:20 PM