-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
142 lines (139 loc) · 4.64 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<Window x:Class="Calculator.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Calculator"
mc:Ignorable="d"
Title="MainWindow" Height="525" Width="350">
<Grid Margin="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--Below code sets the calculate results visual.-->
<Label x:Name="ResultLabel"
Content="0"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
FontSize="60"
Grid.ColumnSpan="4"/>
<!--Below code is for the Buttons of the Calculator.-->
<Button x:Name="AcBtn"
Content="A/C"
Margin="5"
Grid.Row="1"/>
<Button x:Name="NegativeBtn"
Content="+/-"
Margin="5"
Grid.Row="1"
Grid.Column="1"/>
<Button x:Name="PercentageBtn"
Content="%"
Margin="5"
Grid.Row="1"
Grid.Column="2"/>
<Button x:Name="DivideBtn"
Click="OperationBtn_Click"
Content="/"
Margin="5"
Grid.Row="1"
Grid.Column="3"/>
<Button x:Name="SevenBtn"
Click="NumberBtn_Click"
Content="7"
Margin="5"
Grid.Row="2"/>
<Button x:Name="EightBtn"
Click="NumberBtn_Click"
Content="8"
Margin="5"
Grid.Row="2"
Grid.Column="1"/>
<Button x:Name="NineBtn"
Click="NumberBtn_Click"
Content="9"
Margin="5"
Grid.Row="2"
Grid.Column="2"/>
<Button x:Name="TimesBtn"
Click="OperationBtn_Click"
Content="*"
Margin="5"
Grid.Row="2"
Grid.Column="3"/>
<Button x:Name="FourBtn"
Click="NumberBtn_Click"
Content="4"
Margin="5"
Grid.Row="3"/>
<Button x:Name="FiveBtn"
Click="NumberBtn_Click"
Content="5"
Margin="5"
Grid.Row="3"
Grid.Column="1"/>
<Button x:Name="SixBtn"
Click="NumberBtn_Click"
Content="6"
Margin="5"
Grid.Row="3"
Grid.Column="2"/>
<Button x:Name="MinusBtn"
Click="OperationBtn_Click"
Content="-"
Margin="5"
Grid.Row="3"
Grid.Column="3"/>
<Button x:Name="OneBtn"
Click="NumberBtn_Click"
Content="1"
Margin="5"
Grid.Row="4"/>
<Button x:Name="TwoBtn"
Click="NumberBtn_Click"
Content="2"
Margin="5"
Grid.Row="4"
Grid.Column="1"/>
<Button x:Name="ThreeBtn"
Click="NumberBtn_Click"
Content="3"
Margin="5"
Grid.Row="4"
Grid.Column="2"/>
<Button x:Name="PlusBtn"
Click="OperationBtn_Click"
Content="+"
Margin="5"
Grid.Row="4"
Grid.Column="3"/>
<Button x:Name="ZeroBtn"
Click="NumberBtn_Click"
Content="0"
Margin="5"
Grid.ColumnSpan="2"
Grid.Row="5"/>
<Button x:Name="PointBtn"
Click="PointBtn_Click"
Content="."
Margin="5"
Grid.Row="5"
Grid.Column="2"/>
<Button x:Name="EqualsBtn"
Content="="
Margin="5"
Grid.Row="5"
Grid.Column="3"/>
</Grid>
</Window>