2
Answers

how to call a static function of class Form?

Ask a question
tata

tata

14y
3.3k
1
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.

Answers (2)