private void formatCodeToolStripMenuItem_Click(object sender, EventArgs e) { try { Status("Started source code formatting..."); errProvider.Clear(); var formattedText = vbScript.FormatCode(txtSourceCode.Text); txtSourceCode.Text = formattedText; LoadStats(); Status("Source code formatting completed"); } catch (Exception) { StatusError("Error occured while formatting source code..."); } }