Beispiel #1
0
 void Template_TextBoxKeyDown(object sender, KeyEventArgs e)
 {
     if (e.Control && (e.KeyCode == Keys.A))
     {
         Template_TextBox.SelectAll();
     }
 }
Beispiel #2
0
        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);
            }
        }