variables - Using parameter in constructors C# -


i'm abit new in c#. have code this:

namespace example {     public partial class example_setting : form     {         public example_setting(string somethings)         {         }         private myplace()         {              messagebox.show(somethings);         }     } 

i don't know how value of somethings variable in myplace().how can do?

an example be:

namespace example {     public partial class example_setting : form     {         string somethings; // <-- declare variable in class         public example_setting(string somethings)         {               this.somethings = somethings; // save param variable         }         private myplace()         {              messagebox.show(somethings); // data here use         }     } 

Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -