How do i catch an error in a int parsed from string?
<p>I am having trubble finding a way that works and helps to catch an error input. I need to handle if the input is not a 1 or a 2. Like . or a - or just any letter. I have tried catch and well nothing seems to work :/ </p>

<p>Someone that have an idea for me to try? I am greatfull for any suggestions!! Thx in advance! </p>

<p>Regards</p>

<p>The code i have written so far looks like this:</p>

<pre><code>console.WriteLine();
Console.Write("Make your choice: ");


int myinput = int.Parse(Console.ReadLine());

if (myinput == 1)
{
FirstEvent();
}
if (myinput == 2)
{
SecondEvent();
}
</code></pre>
