I want to create a function "public static void draw()" in class "public partial class Form1 : Form" in my C# window form application.
When i set static to my own function , i can not use controls in form . Specific , i want to use event Paint of a my panel in form ( i name it is panel1 ) by call panel1.Invalidate(); in my own function (draw) . But when my function is set to static ( i want use it in other class ) , i can not use this control panel. Can you help me a solution? Thank you very much.
How to call a static function of class Form?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Sam HobbsRank #108 · 20.5K reputationPosted Mar 24, 2010, 4:56 PM EDT
tata3 reputationPosted Mar 24, 2010, 7:16 PM EDT