复盖?比较难,但你可以自己再usercontrol中增加一个事件,用于在button中click时执行这个你定义的事件,这样你的uc就会有一个button单击事件的了
如果一定要做复盖,那就得做消息处理,就是控件或窗口的消息执行事件

解决方案 »

  1.   

    usercontrol定义一个事件跟定义一个属性差不多
      

  2.   

    我现在就是在uc中定义了一个自定义事件,可是如何将这个自定义事件与button的click联系起来呢?同时能够在form窗体中应用这个uc的时候我在自定义事件中自由的代码能够在单击button的click时运行???望不吝赐教!
      

  3.   

    我现在就是在uc中定义了一个自定义事件,可是如何将这个自定义事件与button的click联系起来呢?同时能够在form窗体中应用这个uc的时候我在自定义事件中自由的代码能够在单击button的click时运行???望不吝赐教!
      

  4.   

    添加一个EventHandler,然后为其添加set方法,使Click指向Button。
    控件:
    public EventHandler UIClick { set { this.button1.Click += value; } }
    程序:
    private void My_Click(object sender, EventArgs e)
    {
        //TODO: Add Click Event
        MessageBox.Show("well, you click me!");
    }
    MyControl myControl = new MyControl();
    myControl.UIClick = My_Click;
      

  5.   

      public event EventHandler<EventArgs> click;        
            private void button1_Click(object sender, EventArgs e)
            {
                this.click(sender,e);
            }用单击事件的时候用click就好了
      

  6.   

      private void Form1_Load(object sender, EventArgs e)
            {
                userControl11.click += new EventHandler<EventArgs>(userControl11_click);
            }        void userControl11_click(object sender, EventArgs e)
            {
                throw new Exception("The method or operation is not implemented.");
            }