我现在很迷惑。分不清这两个函数的作用。什么时候应该用他们了!!!!
1》 private void Form1_Paint(object sender, PaintEventArgs e)
{ }
2》 protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
}请分别讲一下。这个2个函数的作用。应该怎么来用?
还有 这两类函数的区别和用法。两类只的是用事件的Form1_Paint等和重载的OnPaint()类的!!!个人认为2个函数都貌似与vc里边的虚函数 onpaint()。是这个道理么?
1》 private void Form1_Paint(object sender, PaintEventArgs e)
{ }
2》 protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
}请分别讲一下。这个2个函数的作用。应该怎么来用?
还有 这两类函数的区别和用法。两类只的是用事件的Form1_Paint等和重载的OnPaint()类的!!!个人认为2个函数都貌似与vc里边的虚函数 onpaint()。是这个道理么?
public class Label
{
private OnPaint()
{
//我是一个控件要有自己的界面
}//想要我表现的不一样,订阅我的事件
public event Paint;
}
Paint是个事件处理函数,就是事件激发时候调用的方法