title: how to declare a public string with a textbox's text
body: <p>i am trying to do</p>
  
  <pre><code>      public string str = txtText.Text;
  </code></pre>
  
  <p>but it wont let me use txtText.txt so how would I declare that so it can be used everywhere?</p>
  
  <p>I can't use it in the button1_click event because if I do it messes it up because I am having a string retrieve from the textbox and set to the textbox so it doesn't work right so I have to have it retrieve the textbox's text somewhere else then set to it.</p>