public static void textBox_Leave(object sender, EventArgs e) { System.Windows.Forms.TextBox tb = (System.Windows.Forms.TextBox)sender; tb.Text = Functions.TextFormat(tb.Text); }