Paint Event Handler [modified]
-
The paint event is handled upon a form is loaded: Panel.Paint += new System.Windows.Forms.PaintEventHandler(Panel_Paint); And I have added the panel.Invalidate() method in the treeView1_AfterSelect event. There are unwanted text for the default node. But when I select another node and get back to the default node, the unwanted text is gone. I tried to debug it and accidentally found that the paint event is handled even without the Invalidate() method (well, it works for the first few nodes but not the rest). I'm just wondering how does the program know when to paint those text - ie. when it is triggered to paint. It seemed to me that only the text for the default node has been painted twice. So if I can understand how the paint event is triggered, that might help to confirm whether it has been painted twice. -- modified at 3:40 Friday 23rd June, 2006