So, I'm working in C# and for some reason my conversion is throwing exceptions, the code is meant to execute when user presses a button, here is the code.
private void tbVerk6Breidd_KeyDown(object sender, KeyEventArgs e)
{
int width = Convert.ToInt32(tbTextBox.Text); //Crashes here
}
Any help appreciated :)
Edit
Heki mentioned that KeyUp would be a better idea, that worked. Thanks :)
private void tbVerk6Breidd_KeyUp(object sender, KeyEventArgs e)
{
int width = Convert.ToInt32(tbTextBox.Text);
}