How can i pass/use private variables froma class in Form1 with a public function?

前端 未结 5 754
粉色の甜心
粉色の甜心 2021-01-27 05:28

I don\'t want to make a new instance of Form1 in the class, and i dont want to use static.

I have these two variables which are private in the top of the cl

5条回答
  •  失恋的感觉
    2021-01-27 06:05

    The canonical solution is

    private List mPoint_X = new List();
    private List mPoint_Y = new List();
    
    public List Point_X { get { return mPoint_X; } }
    public List Point_Y { get { return mPoint_Y; } }
    

提交回复
热议问题