Administrator

Administrator

  • Tech Writer
  • 2.2k
  • 1.5m

render existing component to custom Graphics map

Mar 18 2003 3:12 PM
Basically, I want to take an existing Win Forms component (datagrid) and set my own Graphics object so that all painting occurs on my object instead of painting to the screen. I thought this should be easy enough. The OnPaint method accepts PaintEventArgs. I can set the Graphics object in the PaintEventArgs to my own. But oops...OnPaint is protected. No problem, I'll just create my own object that inherits from DataGrid and overload the OnPaint. In here, I just call the base OnPaint and pass in my own PaintEventArgs. No dice. Any suggestions? Has anyone else tried this? regards Michael Anderson