It might be helpful,
namespace UITest
{
using System;
using System.Windows.Forms;
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnIncrement_Click(object sender, EventArgs e)
{
textBox1.Text = IncrementedResult(textBox2.Text).ToString();
}
private Int32 IncrementedResult(string dataToParse)
{
int result;
return Int32.TryParse(dataToParse, out result) ? ++result : result;
}
}
}
:)