title: Get the ownercontrol of a graphics object?
body: <p>Is possible to know the ownercontrol of a <code>Graphics</code> object?</p>
  
  <p>In this method I'm passing the graphics object of a control to a custom method, together with the control's width and height:</p>
  
  <pre><code>Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As PaintEventArgs) _
  Handles PictureBox1.Paint
  
      Me.MyMethod(g:=e.Graphics, Width:=sender.width, Height:=sender.height)
  
  End Sub
  </code></pre>
  
  <p>But I would like to avoid passing the width and height parametters to my method (or else passing the control), instead that <code>MyMethod</code> should find the control width/hight just with the graphics object, in case this could be possibly. </p>
  
  <p>Something like this pseudocode:</p>
  
  <pre><code>private sub mymethod(byval g as graphics)
  
      dim _width as integer = g.GetControlWidth
      dim _height as integer = g.GetontrolHeight
  
  end sub
  </code></pre>