1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
Public Class CLFWAddPanel
Inherits Panel
Private Sub PaintParentBackground(ByVal e As PaintEventArgs)
If Not Me.Parent Is Nothing Then
Dim rect As Rectangle = New Rectangle(Left, Top, Width, Height)
e.Graphics.TranslateTransform(-rect.X, -rect.Y)
Dim pea As PaintEventArgs = New PaintEventArgs(e.Graphics, rect)
pea.Graphics.SetClip(rect)
InvokePaintBackground(Parent, pea)
InvokePaint(Parent, pea)
e.Graphics.TranslateTransform(rect.X, rect.Y)
Else
e.Graphics.FillRectangle(SystemBrushes.Control, ClientRectangle)
End If
End Sub
Protected Overrides Sub OnPaintBackground( _
ByVal pevent As PaintEventArgs)
PaintParentBackground(pevent)
End Sub
Protected Overrides Sub OnScroll( _
ByVal se As ScrollEventArgs _
)
PaintParentBackground(New PaintEventArgs(Me.CreateGraphics, Me.Bounds))
MyBase.OnScroll(se)
End Sub
End Class |
Partager