I am trying to make a UserControl or Component which can be dragged from the Toolbox onto a container control such as a Form or a Panel. Its purpose is to change the behaviour of that container. In particular, I would like to add functions to the container's painting and mouse actions. I DO NOT want to have to write code for the container itself -- that's the whole point of the Toolbox object.

I can do this by getting a reference to the object's Parent (or Host in the case of a Component) and handling its events, as this example illustrates:
vb Code:
  1. Public Class DeformablePolygon
  2.     Inherits Windows.Forms.UserControl
  3.  
  4.     Private WithEvents _Parent As Windows.Forms.Control
  5.     Public Property VertexCollection As System.Drawing.PointF()
  6.  
  7.     Protected Overrides Sub OnParentChanged(e As System.EventArgs)
  8.         _Parent = Me.Parent
  9.         MyBase.OnParentChanged(e)
  10.     End Sub
  11.  
  12.     Private Sub _Parent_Paint(sender As Object, e As System.Windows.Forms.PaintEventArgs) Handles _Parent.Paint
  13.         If _VertexCollection IsNot Nothing Then
  14.             e.Graphics.DrawPolygon(System.Drawing.Pens.Black, _VertexCollection)
  15.         End If
  16.     End Sub
  17.  
  18. '+ mouse events etc.
  19.  
  20. End Class
However, I have heard that handling the events of a parent control conflicts with OOP principles. So I would like to know, does that objection apply in a case like my example? If so, what are the drawbacks? And what alternative techniques are available?

BB