0
我試圖繼承方法button1_click,並且我得到了上面的消息,如何解決該問題?無法將類型'MouseEventHandler'隱式轉換爲'RoutedEventHandler
namespace visualinheritance
{
public partial class usercontrolcommon : UserControl
{
public usercontrolcommon()
{
InitializeComponent();
}
public void button1_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("usercontrolcommon");
}
}
}
namespace visualinheritance
{
public partial class usercontrol1 : usercontrolcommon
{
public usercontrol1()
{
InitializeComponent();
this.button1.Click += new MouseEventHandler(button1_Click);
}
}
}
您可能需要查看C#[大寫字母順序](http://msdn.microsoft.com/zh-cn/library/ms229043.aspx)。 – 2011-04-30 20:51:59