ScrollableControl.OnPaintBackground(PaintEventArgs) 方法
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
绘制控件的背景。
protected:
override void OnPaintBackground(System::Windows::Forms::PaintEventArgs ^ e);
C#
protected override void OnPaintBackground (System.Windows.Forms.PaintEventArgs e);
override this.OnPaintBackground : System.Windows.Forms.PaintEventArgs -> unit
Protected Overrides Sub OnPaintBackground (e As PaintEventArgs)
事件数据。
仅限 .NET 5 及更高版本: e
是 null
。
引发事件时,将通过委托调用事件处理程序。 有关详细信息,请参阅 处理和引发事件。
OnPaintBackground 方法还允许派生类对事件进行处理而不必附加委托。 这是在派生类中处理事件的首选技术。
在 OnPaintBackground(PaintEventArgs) 派生类中重写时,请务必调用基类 OnPaintBackground(PaintEventArgs) 的方法,以便已注册的委托接收事件。
产品 | 版本 |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 |
Windows Desktop | 3.0, 3.1, 5, 6, 7 |