Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. private void hsb_Scroll(object sender, ScrollEventArgs e)
  2. {
  3. Single Celsius, Fahrenheit;
  4.  
  5. Celsius = hsb.Value ; // hsb= horizontal scroll bar, The value of the scroll bar controlls celsius.
  6. txtbc.Text = Convert.ToString(Celsius) ; // txtbc is the text box for celsius, they look better than labels. Ps: you dont have to do text boxes but regardless its the same code.
  7.  
  8. Fahrenheit = ((Celsius * 9 / 5) + 32); // conversion of Celsius to Fahrenheit.
  9. txtbf.Text = Convert.ToString(Fahrenheit) ; // Places the equation answer into the Fahrenheit Text box
  10. }
  11.  
  12. private void btnclose_Click(object sender, EventArgs e)
  13. {
  14. Application.Exit(); // closes the program with the button
  15. // matt had his equations wrong and had a random box that he labeled "Temperature". You dont need this exta box as it does nothing and makes the equations invalid.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement