C# Update a Variable -


this question has answer here:

i want enter animals using variable. example:

private void button14_click(object sender, eventargs e) {     string newanimal;     newanimal = "pig";     if (textbox1 = newanimal)     {         //some other code      } } 

is possible update variable newanimal different animal, cow in different textbox, textbox2? cant figure out how update variable

thank you. beginner. appreciated.

here how put content of textbox2 newanimal string:

private void button14_click(object sender, eventargs e) {     string newanimal;     newanimal = "pig";     if (textbox1.text == newanimal)     {         newanimal = textbox2.text;     } } 

note check equality, should use == operator instead of =.


Comments

Popular posts from this blog

xslt - Substring before throwing error -

Google Cloud Bigtable Durability/Availability Guarantees -

Android M doze mode and "native" posix socket freezing up -