// Бекспейс private void buttonBack_Click(object sender, EventArgs e) { int csel = ScreenBox.SelectionStart; if (ScreenBox.Text.Length != 0 && csel != 0) { ScreenBox.Text = ScreenBox.Text.Substring(0, csel - 1) + ScreenBox.Text.Substring(csel, ScreenBox.Text.Length - csel); csel -= 1; } ScreenBox.Focus(); ScreenBox.Select(csel, 0); if (Properties.Settings.Default.AutoALT && checkBoxMode.Checked) { checkBoxMode.Checked = false; } }
private void buttonFunct_Click(object sender, EventArgs e) { int csel = ScreenBox.SelectionStart; if (ScreenBox.Text.Length != 0 && csel != 0) { ScreenBox.Text = ScreenBox.Text.Substring(0, csel) + ((Button)sender).Text + "(" + ScreenBox.Text.Substring(csel, ScreenBox.Text.Length - csel); } else { ScreenBox.Text = ((Button)sender).Text + "(" + ScreenBox.Text.Substring(csel, ScreenBox.Text.Length - csel); } csel += ((Button)sender).Text.Length + 1; ScreenBox.Focus(); ScreenBox.Select(csel, 0); if (Properties.Settings.Default.AutoALT && checkBoxMode.Checked) { checkBoxMode.Checked = false; } }