// CMD // KeyDown private void Txtcommand_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.RightCtrl) { if (LblSolve.Text.ToString().Length >= 1) { Txtcommand.Focus(); string[] TMP = new string[2]; TMP = LblSolve.Text.ToString().Split(','); Txtcommand.Text = TMP[0]; Txtcommand.SelectAll(); } } // I Dont Like && So I Write Like This \/ if (DoCMD.IsChecked == true) { if (e.Key == Key.Enter) { if (Txtcommand.Text.Length >= 1) { if (char.IsLetter(Txtcommand.Text[0])) { File.AppendAllText("hisory.list.csv", "\n" + Txtcommand.Text); System.Diagnostics.Process.Start("CMD.exe", "/k" + Txtcommand.Text); } } } } }
private void Window_Loaded(object sender, RoutedEventArgs e) { Txtcommand.Focus(); DoCMD.IsChecked = Properties.Settings.Default.BoolDoCcmd; DoCalc.IsChecked = Properties.Settings.Default.BoolDocalc; }