void Template_TextBoxKeyDown(object sender, KeyEventArgs e) { if (e.Control && (e.KeyCode == Keys.A)) { Template_TextBox.SelectAll(); } }
void EscapeSelectedXMLStringButtonClick(object sender, EventArgs e) { string selectiontext = Template_TextBox.SelectedText; if (!string.IsNullOrEmpty(selectiontext)) { int selectionstart = Template_TextBox.SelectionStart; int selectionlength = Template_TextBox.SelectionLength; string template = Template_TextBox.Text; string prestring = template.Substring(0, selectionstart); string sufstring = template.Substring(selectionstart + selectionlength); selectiontext = XMLUtils.XMLFormatter.XmlEscape(selectiontext); Template_TextBox.Text = prestring + selectiontext + sufstring; Template_TextBox.Refresh(); Template_TextBox.Select(selectionstart, selectiontext.Length); } }