I’m trying to make a unit converter and what I have is one button and two textboxes. What I want the button when pressed to do is convert whatever is entered to the other side (what isnt entered)
ALSO! Another thing that would be great would be how do I implement a drop down menu so I dont need to do so many buttons and fields? Thanks <3
TEXTBOX BUTTON TEXTBOX2 (say TEXTBOX is Fahrenheit and TEXTBOX2 is Celsius) I enter in the Fahrenheit and leave TEXTBOX2 and hit the button I should get the Celsius now. Simple enough right?
Here is what I have:
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 UnitConverter
{
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
if (boxc.Text=="")
boxc.Text = (Convert.ToDouble(boxf.Text) * 9 /5) +32;
}
}
}
Sorry when it comes to numbers and strings I always get thrown for a loop :\ Thanks in advance for any help.
Replace
With