using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace t8_elements { /// /// Interaction logic for MainWindow.xaml /// public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void acceptButton_Click(object sender, RoutedEventArgs e) { MessageBox.Show("действие выполнено"); } private void escButton_Click(object sende, RoutedEventArgs e) { this.Close(); } private void checkBox_Unchecked(object sender, RoutedEventArgs e) { MessageBox.Show(checkBox.Content.ToString() + " не отмечен"); } private void checkBox_Checked(object sender, RoutedEventArgs e) { MessageBox.Show(checkBox.Content.ToString() + " отмечен"); } private void checkBox_Indeterminate(object sender, RoutedEventArgs e) { MessageBox.Show(checkBox.Content.ToString() + " в неопределенном состоянии"); } private void RadioButton_Checked(object sender, RoutedEventArgs e) { RadioButton pressed = (RadioButton)sender; MessageBox.Show(pressed.Content.ToString()); } private void Button_Click(object sender, RoutedEventArgs e) { textBox1.SelectionStart = 5; textBox1.SelectionLength = 10; textBox1.Focus(); // данное выражение эквивалентно //textBox1.Select(5, 10); } private void list_Selected(object sender, SelectionChangedEventArgs e) { Phone p = (Phone)list.SelectedItem; MessageBox.Show(p.Title); } } }