question paint method

  • Thread starter Thread starter Franck
  • Start date Start date
F

Franck

Hello,

Sorry if that question has already been raised...

I'm looking for the exact equivalent of Java paint(Graphics g) method in c#
in order to paint a specific component and all its children on a particular
graphics object. Can anyone help me ?

Thanks,

Franck.
 
Hello,

I don't think OnPaint is equivalent to "Java paint" but more to "Java
paintComponent"... "Java paint" call the paintComponent of the current
JComponent (Control in c#) AND the paintComponent of the JComponent
childrens. I think OnPaint doesn't do that...

So I'm looking for a method that can paint a specific control and its
children in a specific graphics object.

Thanks

Franck.
 
In the OnPaint method you could call Invalidate or UpdateWindow on the child
controls, this would have the effect of them painting, but this is not
usually required because generally speaking Windows will invalidate the
controls for you as required.

S.
 
Hello,

When calling Invalidate or Update, I can't give a specific graphics object
in paramater...

The idea is to control the graphics object on which the painting occurs for
the current control and all its children and not let .NET create its own
graphics object.

Any idea ?

Thanks

Franck
 
Back
Top