views:

813

answers:

4

Hello,

My program draws text on its panel,but if I'd like to remove the text I have to repaint.

How do I call(raise) the paint event by hand?

+9  A: 

The Invalidate() Method will cause a repaint.

MSDN Link

Matthew Vines
+3  A: 

Call control.invalidate and the paint event will be raised.

Otávio Décio
+1  A: 

I think you can also call Refresh().

Brian
+1  A: 

Refresh would probably also make for much more readable code, depending on context.

Simon Nunn