Share a variable between two classes

前端 未结 2 1472
深忆病人
深忆病人 2021-01-29 16:23

I have two different .cs windows in just 1 project. Each one runs a different part of my program. But now I need to use a variable (i) of mainwindow.cs in Form.cs. This variable

2条回答
  •  终归单人心
    2021-01-29 16:48

    your default access modifier is private if you don't mention it . Make it public

    public float i {get; set;}  
    

提交回复
热议问题