'宣言 Protected Overrides Sub DrawForeground( _ ByRef drawParams As Infragistics.Win.UIElementDrawParams _ )
protected override void DrawForeground( ref Infragistics.Win.UIElementDrawParams drawParams )
Imports Infragistics.Win Protected Overrides Sub DrawForeground(ByRef drawParams As UIElementDrawParams) ' 前景を ControlLight で描画し、 ' 境界線を ControlDark で描画します Dim Brush As SolidBrush = New SolidBrush(SystemColors.ControlLight) Dim colorRect As Rectangle = Me.Rect colorRect.Inflate(-3, -3) drawParams.Graphics.FillRectangle(Brush, colorRect) colorRect.Width -= 1 colorRect.Height -= 1 drawParams.Graphics.DrawRectangle(SystemPens.ControlDark, colorRect) Brush.Dispose() End Sub
using Infragistics.Win; protected override void DrawForeground(ref UIElementDrawParams drawParams) { // 前景を ControlLight で描画し、 // 境界線を ControlDark で描画します SolidBrush brush = new SolidBrush(SystemColors.ControlLight ); Rectangle colorRect = this.Rect; colorRect.Inflate(-3,-3); drawParams.Graphics.FillRectangle(brush,colorRect); colorRect.Width--; colorRect.Height--; drawParams.Graphics.DrawRectangle(SystemPens.ControlDark,colorRect); brush.Dispose(); }