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 |