Control.OnPaintBackground(PaintEventArgs) 方法

定義

繪製控制項的背景。

C#
protected virtual void OnPaintBackground (System.Windows.Forms.PaintEventArgs pevent);

參數

pevent
PaintEventArgs

PaintEventArgs,含有要繪製的控制項資訊。

備註

方法 OnPaintBackground 可讓衍生類別處理 Windows 背景清除要求。

給繼承者的注意事項

繼承類別應該覆寫這個方法,以處理來自視窗的清除背景要求。 在 OnPaintBackground(PaintEventArgs) 衍生類別中覆寫時,不需要呼叫基類的 OnPaintBackground(PaintEventArgs)

適用於

產品 版本
.NET Framework 1.1, 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

另請參閱