用户控件
小弟添加了一个用户控件并且写了一个Run的方法
public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
}
public void Run()
{ }
private void UserControl1_Load(object sender, EventArgs e)
{
}
}
方法Run不是静态的,为什么能直接用类调用呢?
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
this.userControl11.Run(); }
}