C# Code:
Download here: source code
Concatenate of two numbers:
namespace calculator
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
string numberBTN = String.Concat(button1.Content.ToString(), textBox1.Text);
textBox1.Text = numberBTN;
}
}
}
XAML COde:
<Window x:Class="calculator.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Calculator" Height="350" Width="525">
<Grid>
<TextBox Height="27" HorizontalAlignment="Center" Margin="153,35,0,0" Name="textBox1" VerticalAlignment="Top" Width="200" />
<Button Content="1" Height="23" Margin="234,109,0,0" Name="button1" VerticalAlignment="Top" HorizontalAlignment="Left" Width="36" Click="button1_Click" />
</Grid>
</Window>
Download here: source code
Concatenate of two numbers:
namespace calculator
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
string numberBTN = String.Concat(button1.Content.ToString(), textBox1.Text);
textBox1.Text = numberBTN;
}
}
}
XAML COde:
<Window x:Class="calculator.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Calculator" Height="350" Width="525">
<Grid>
<TextBox Height="27" HorizontalAlignment="Center" Margin="153,35,0,0" Name="textBox1" VerticalAlignment="Top" Width="200" />
<Button Content="1" Height="23" Margin="234,109,0,0" Name="button1" VerticalAlignment="Top" HorizontalAlignment="Left" Width="36" Click="button1_Click" />
</Grid>
</Window>
No comments:
Post a Comment