C# “does not contain a constructor that takes '1' arguments”

前端 未结 5 1023
深忆病人
深忆病人 2020-12-11 18:59

I have read through some of the posts on this site relating to this error but I still can\'t work out how to do this - I\'m quite new to C#.

I am trying to pass mult

5条回答
  •  借酒劲吻你
    2020-12-11 19:47

    as you said if you have N forms then the date Exchange may be , i think ,More than saving it in a file u can use static class with get/set something like

    Lets have a new Class GlobalClass

      public static class GlobalClass
        {
        public static string firstNameTxtBox
        { set; get; }
    
    
        public static string SecondNameTxtBox
        { set; get; }
        }
    

    and u can set from any form (Namespace should b be noted)

    @Form1

    GlobalClass.firstNameTxtBox="This is From 1stForm";
    

    @Form2

    GlobalClass.SecondNameTxtBox="This is From Second Form";
    

提交回复
热议问题