private void Content_Click(object sender, RoutedEventArgs e) { MessageBoxResult result = MessageBox.Show(Properties.Resources.Sure, "Choose further action:", MessageBoxButton.YesNo, MessageBoxImage.Question); if (result == MessageBoxResult.Yes) { EnterConSupp.IsReadOnly = false; EnterConSupp.Clear(); EnterConSupp.Foreground = Brushes.Black; content = true; } }
private void btype_Click(object sender, RoutedEventArgs e) { MessageBoxResult result = MessageBox.Show("Are you sure?", "Choose further action:", MessageBoxButton.YesNo, MessageBoxImage.Question); if (result == MessageBoxResult.Yes) { EnterConSupp.IsReadOnly = false; EnterConSupp.Clear(); EnterConSupp.Foreground = Brushes.Black; Gpa = true; } }
private void ECB_KeyDown(object sender, KeyEventArgs e) { try { if (e.Key == Key.Enter) { if (content == true) { ButtonsList.Items.Insert(ButtonsList.SelectedIndex, new ListBoxItem { Content = EnterConSupp.Text, HorizontalContentAlignment = HorizontalAlignment.Center, Background = Brushes.Gray }); ButtonsList.Items.Remove(ButtonsList.SelectedItem); EnterConSupp.Clear(); EnterConSupp.Foreground = Brushes.Gray; EnterConSupp.IsReadOnly = true; content = false; } if (Gpa == true) { ButtonSupplement.Items.RemoveAt(ButtonsList.SelectedIndex); ButtonSupplement.Items.Insert(ButtonsList.SelectedIndex, new ListBoxItem { Content = "(" + EnterConSupp.Text + ")", Foreground = Brushes.White }); EnterConSupp.Clear(); EnterConSupp.Foreground = Brushes.Gray; EnterConSupp.IsReadOnly = true; Gpa = false; } } } catch (Exception exp) { MessageBox.Show(exp.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }