Need to wait for'KeyDown' Enter to accept TextBox text
<p>I need to have a way to set an integer in a method by taking the users input from a textbox. The problem is that I need to pause the code to allow input to be typed then to resume when 'Enter' is keyed. Keydown method works but not for setting a variable local to an outside method.
For instance:</p>

<pre><code>....method()
{
    int num = 0;

    //wait for keydown Enter

    num = Convert.ToInt32(TextBox1.Text);
    //or 
    String s = TextBox1.Text;
    num = Int.TryParse(s);

    ....
 }
</code></pre>
