Private WithEvents pb As CustomPictureBox Private Sub pb_Paint(ByVal sender As Object, ByVal e As PaintEventArgs) Handles pb.Paint DrawBackGround(e.Graphics, e.ClipRectangle) DrawBlackRect(e.Graphics, New Rectangle(10, 10, 100, 100)) DrawRedRect(e.Graphics, New Rectangle(20, 20, 100, 100)) End Sub Private Sub DrawBackGround(ByVal g As Graphics, ByVal r As RectAngle) g.FillRectangle(Brushes.White, r) End Sub Private Sub DrawBlackRect(ByVal g As Graphics, ByVal r As RectAngle) g.FillRectangle(Brushes.Black, r) End Sub Private Sub DrawRedRect(ByVal g As Graphics, ByVal r As RectAngle) g.FillRectangle(Brushes.Red, r) End Sub