コード例 #1
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            // Check text boxes to see if they are empty or not
            if (lastName.Text == "")
            {
                lastName.Background = System.Windows.Media.Brushes.Pink;
                lastName.Focus();
            }
            else
            {
                lastName.Background = System.Windows.Media.Brushes.White;
            }

            if (firstName.Text == "")
            {
                firstName.Background = System.Windows.Media.Brushes.Pink;
                firstName.Focus();
            }
            else
            {
                firstName.Background = System.Windows.Media.Brushes.White;
            }



            // If both are not empty, go ahead and show popup window
            if (firstName.Text != "" && lastName.Text != "")
            {
                // Check names in popup window
                Window1 wind = new WpfApplication3.Window1(firstName.Text, lastName.Text);
                wind.Closing += changeButton;
                wind.ShowDialog();
            }
        }
コード例 #2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Alert1 = ((WpfApplication3.Window1)(target));
                return;

            case 2:
                this.Alert = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:

            #line 15 "..\..\Window1.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_1);

            #line default
            #line hidden
                return;

            case 4:
                this.ADis = ((System.Windows.Controls.TextBox)(target));

            #line 17 "..\..\Window1.xaml"
                this.ADis.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.TextBox_TextChanged_1);

            #line default
            #line hidden
                return;

            case 5:

            #line 18 "..\..\Window1.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_2);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
コード例 #3
0
ファイル: Window1.g.i.cs プロジェクト: skishchampi/TSLU
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.AddNewRecord = ((WpfApplication3.Window1)(target));
     return;
     case 2:
     this.Titled = ((System.Windows.Controls.Label)(target));
     return;
     case 3:
     this.Author = ((System.Windows.Controls.Label)(target));
     return;
     case 4:
     this.label3 = ((System.Windows.Controls.Label)(target));
     return;
     case 5:
     this.label4 = ((System.Windows.Controls.Label)(target));
     return;
     case 6:
     this.label5 = ((System.Windows.Controls.Label)(target));
     return;
     case 7:
     this.label6 = ((System.Windows.Controls.Label)(target));
     return;
     case 8:
     this.label7 = ((System.Windows.Controls.Label)(target));
     return;
     case 9:
     this.label10 = ((System.Windows.Controls.Label)(target));
     return;
     case 10:
     this.label13 = ((System.Windows.Controls.Label)(target));
     return;
     case 11:
     this.title = ((System.Windows.Controls.TextBox)(target));
     return;
     case 12:
     this.numberofwords = ((System.Windows.Controls.TextBox)(target));
     return;
     case 13:
     this.part = ((System.Windows.Controls.TextBox)(target));
     return;
     case 14:
     this.volume = ((System.Windows.Controls.TextBox)(target));
     return;
     case 15:
     this.isbn = ((System.Windows.Controls.TextBox)(target));
     return;
     case 16:
     this.numberofcopies = ((System.Windows.Controls.TextBox)(target));
     return;
     case 17:
     this.addmoreauthor = ((System.Windows.Controls.Button)(target));
     
     #line 22 "..\..\..\Window1.xaml"
     this.addmoreauthor.Click += new System.Windows.RoutedEventHandler(this.addmoreauthor_Click);
     
     #line default
     #line hidden
     return;
     case 18:
     this.addnewpublisher = ((System.Windows.Controls.Button)(target));
     
     #line 23 "..\..\..\Window1.xaml"
     this.addnewpublisher.Click += new System.Windows.RoutedEventHandler(this.addnewpublisher_Click);
     
     #line default
     #line hidden
     return;
     case 19:
     this.addnewcategory = ((System.Windows.Controls.Button)(target));
     
     #line 24 "..\..\..\Window1.xaml"
     this.addnewcategory.Click += new System.Windows.RoutedEventHandler(this.addnewcategory_Click);
     
     #line default
     #line hidden
     return;
     case 20:
     this.label18 = ((System.Windows.Controls.Label)(target));
     return;
     case 21:
     this.textBox3 = ((System.Windows.Controls.TextBox)(target));
     return;
     case 22:
     this.label8 = ((System.Windows.Controls.Label)(target));
     return;
     case 23:
     this.button3 = ((System.Windows.Controls.Button)(target));
     return;
     case 24:
     this.label9 = ((System.Windows.Controls.Label)(target));
     return;
     case 25:
     this.button4 = ((System.Windows.Controls.Button)(target));
     
     #line 30 "..\..\..\Window1.xaml"
     this.button4.Click += new System.Windows.RoutedEventHandler(this.button4_Click);
     
     #line default
     #line hidden
     return;
     case 26:
     this.AddRecord = ((System.Windows.Controls.Button)(target));
     
     #line 31 "..\..\..\Window1.xaml"
     this.AddRecord.Click += new System.Windows.RoutedEventHandler(this.AddRecord_Click);
     
     #line default
     #line hidden
     return;
     case 27:
     this.comboBox1 = ((System.Windows.Controls.ComboBox)(target));
     return;
     case 28:
     this.comboBox2 = ((System.Windows.Controls.ComboBox)(target));
     return;
     case 29:
     this.textBox1 = ((System.Windows.Controls.TextBox)(target));
     return;
     case 30:
     this.Notes = ((System.Windows.Controls.Label)(target));
     return;
     case 31:
     this.comboBox3 = ((System.Windows.Controls.ComboBox)(target));
     return;
     }
     this._contentLoaded = true;
 }