Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Net;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Animation;
- using System.Windows.Shapes;
- using Microsoft.Phone.Controls;
- namespace PhoneApp1
- {
- public partial class Newton : PhoneApplicationPage
- {
- public Newton()
- {
- InitializeComponent();
- }
- private void OK_Click(object sender, RoutedEventArgs e)
- {
- double a = 0, b = 0, c = 0;
- a = (((double.Parse(TempNewton.Text) * 60) / 11) + 32);
- b = (((double.Parse(TempNewton.Text)) * 100)/ 33);
- c = (((double.Parse(TempNewton.Text) * 100) / 33) + 273.15);
- {
- RFahrenheit.Text = a.ToString();
- RCelsius.Text = b.ToString();
- RNewton.Text = c.ToString();
- }
- }
- private void negativo_Click(object sender, RoutedEventArgs e)
- {
- if (TempNewton.Text.StartsWith("-"))
- TempNewton.Text = TempNewton.Text.Substring(1);
- else
- TempNewton.Text = "-" + TempNewton.Text;
- }
- private void button1_Click(object sender, RoutedEventArgs e)
- {
- NavigationService.GoBack();
- }
- protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
- {
- base.OnBackKeyPress(e);
- if (TempNewton.Text != string.Empty)
- {
- var result = MessageBox.Show("Tem certeza que quer sair?",
- "Aviso", MessageBoxButton.OKCancel);
- if (result != MessageBoxResult.OK)
- {
- e.Cancel = true;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement