0

Possible Duplicate:
How do I call paint event?

I have a user custom user control which draws some text on its paint event. I am adding this control to a form and at the same time I’m setting the position of the control.

The problem I am having is the paint event doesn’t get fired unless I set the dock style to fill. But I don’t need the dock style to be filled. Is there any way that I can fire the paint event of control manually?

Also any suggestion why the paint event doesn't fire automatically and get fired when the dock style is filled?

Thanks

Community
  • 1
  • 1
huMpty duMpty
  • 14,061
  • 13
  • 55
  • 93

1 Answers1

1

You can use

Control.Invalidate();

or

Control.Refresh();

To force a direct paint event

Arthur
  • 141
  • 5
  • 12