Geocities web hosting - Chapter 8 Object-Based Programming 303 60 displayLabel2.Text =
Chapter 8 Object-Based Programming 303 60 displayLabel2.Text = “Standard time: ” + 61 time.ToStandardString() + “nUniversal time: ” + 62 time.ToUniversalString(); 63 } 64 65 // set Hour property when hourButton pressed 66 private void hourButton_Click( 67 object sender, System.EventArgs e ) 68 { 69 time.Hour = Int32.Parse( hourTextBox.Text ); 70 hourTextBox.Text = “”; 71 UpdateDisplay(); 72 } 73 74 // set Minute property when minuteButton pressed 75 private void minuteButton_Click( 76 object sender, System.EventArgs e ) 77 { 78 time.Minute = Int32.Parse( minuteTextBox.Text ); 79 minuteTextBox.Text = “”; 80 UpdateDisplay(); 81 } 82 83 // set Second property when secondButton pressed 84 private void secondButton_Click( 85 object sender, System.EventArgs e ) 86 { 87 time.Second = Int32.Parse( secondTextBox.Text ); 88 secondTextBox.Text = “”; 89 UpdateDisplay(); 90 } 91 92 // add one to Second when addButton pressed 93 private void addButton_Click( 94 object sender, System.EventArgs e ) 95 { 96 time.Second = ( time.Second + 1 ) % 60; 97 98 if ( time.Second == 0 ) 99 { 100 time.Minute = ( time.Minute + 1 ) % 60; 101 102 if ( time.Minute == 0 ) 103 time.Hour = ( time.Hour + 1 ) % 24; 104 } 105 106 UpdateDisplay(); 107 108 } // end method addButton_Click 109 110 } // end class TimeTest3 Fig. 8.7 Fig. 8.7Fig. 8.FiFi7g. 8.7g.8.7Properties demonstration for class Time3. (Part 3 of 5.)
We recommend you use shared web hosting services, because many users agree that it is cheap, reliable and customer-satisfying webhost.