Adelphia web hosting - 1370 COM Integration Appendix H 21 // integer

1370 COM Integration Appendix H 21 // integer text boxes 22 private System.Windows.Forms.TextBox resultBox; 23 private System.Windows.Forms.TextBox firstIntegerBox; 24 private System.Windows.Forms.TextBox secondIntegerBox; 25 26 // calculates addition 27 private System.Windows.Forms.Button calculateButton; 28 29 private CAddition additionObject = new CAddition(); 30 31 // Required designer variable. 32 private System.ComponentModel.Container 33 components = null; 34 35 public Addition() 36 { 37 InitializeComponent(); 38 } 39 40 // Visual Studio .NET generated code 41 42 // The main entry point for the application. 43 [STAThread] 44 static void Main() 45 { 46 Application.Run( new Addition() ); 47 } 48 49 // event handler to enable calculateButton 50 private void integerBox_TextChanged( object sender, 51 System.EventArgs e ) 52 { 53 // enable calculate button if both boxes 54 // contain text 55 if ( firstIntegerBox.Text != “” && 56 secondIntegerBox.Text != “” ) 57 calculateButton.Enabled = true; 58 else 59 calculateButton.Enabled = false; 60 } // end method integerBox_TextChanged 61 62 // event handler that displays sum when calculate 63 // is clicked 64 private void calculateButton_Click( object sender, 65 System.EventArgs e ) 66 { 67 int firstInteger, secondInteger, total; 68 69 firstInteger = Int32.Parse( firstIntegerBox.Text ); 70 secondInteger = Int32.Parse( secondIntegerBox.Text ); 71 72 // addition object invokes AddFunction that 73 // returns integer value Fig. H.6 COM DLL component in C#. (Part 2 of 3.)
Go visit our java server pages services for a reliable, lowcost webhost to satisfy all your needs.

Leave a Reply