[C#] 22일차 - 163. WPF 윈도우 표준 계산기의 디자인C#/C#200제2021. 3. 6. 00:14
Table of Contents
<Window x:Class="A163_WPF_Windows.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:A163_WPF_Windows"
mc:Ignorable="d"
Title="윈도우 표준 계산기" MinHeight="550" MinWidth="300" Width="400" Height="550" Background="WhiteSmoke">
<DockPanel VerticalAlignment="Stretch">
<Grid Height="100" DockPanel.Dock="Top">
<TextBox Name="txtExp" FontSize="16" HorizontalContentAlignment="Right" Margin="15" BorderThickness="0" Background="WhiteSmoke"></TextBox>
<TextBox Name="txtResult" Height="50" FontWeight="Bold" FontSize="36" HorizontalContentAlignment="Right" VerticalContentAlignment="Bottom" Margin="10,10,15,10" BorderThickness="0" Background="WhiteSmoke">0</TextBox>
</Grid>
<Grid Height="50" Background="LightGray" DockPanel.Dock="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button Name="btnMC" Grid.Column="0" FontSize="14" BorderThickness="0" FontWeight="Bold" Background="WhiteSmoke" IsEnabled="False">MC</Button>
<Button Name="btnMR" Grid.Column="1" FontSize="14" BorderThickness="0" FontWeight="Bold" Background="WhiteSmoke" IsEnabled="False">MR</Button>
<Button Name="btnMPlus" Grid.Column="2" FontSize="14" BorderThickness="0" FontWeight="Bold" Background="WhiteSmoke" IsEnabled="False">M-</Button>
<Button Name="btnMMinus" Grid.Column="3" FontSize="14" BorderThickness="0" FontWeight="Bold" Background="WhiteSmoke" IsEnabled="False">M+</Button>
<Button Name="btnMs" Grid.Column="4" FontSize="14" BorderThickness="0" FontWeight="Bold" Background="WhiteSmoke" IsEnabled="False">MS</Button>
</Grid>
<Grid MinHeight="360" Background="LightGray">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Button Grid.Row="0" Grid.Column="0" FontSize="18" BorderThickness="0" Margin="2,1,1,1" >%</Button>
<Button Grid.Row="0" Grid.Column="1" FontSize="18" BorderThickness="0" Margin="2,1,1,1" >√</Button>
<Button Grid.Row="0" Grid.Column="2" FontSize="18" BorderThickness="0" Margin="2,1,1,1" >x²</Button>
<Button Grid.Row="0" Grid.Column="3" FontSize="18" BorderThickness="0" Margin="2,1,1,1" >1/x</Button>
<Button Grid.Row="1" Grid.Column="0" FontSize="18" BorderThickness="0" Margin="2,1,1,1" >CE</Button>
<Button Grid.Row="1" Grid.Column="1" FontSize="18" BorderThickness="0" Margin="2,1,1,1" >C</Button>
<Button Grid.Row="1" Grid.Column="2" FontSize="18" BorderThickness="0" Margin="2,1,1,1" >a</Button>
<Button Grid.Row="1" Grid.Column="3" FontSize="18" BorderThickness="0" Margin="2,1,1,1" >/</Button>
<Button Grid.Row="2" Grid.Column="0" FontSize="18" BorderThickness="0" Margin="2,1,1,1" Background="WhiteSmoke">7</Button>
<Button Grid.Row="2" Grid.Column="1" FontSize="18" BorderThickness="0" Margin="2,1,1,1" Background="WhiteSmoke">8</Button>
<Button Grid.Row="2" Grid.Column="2" FontSize="18" BorderThickness="0" Margin="2,1,1,1" Background="WhiteSmoke">9</Button>
<Button Grid.Row="2" Grid.Column="3" FontSize="18" BorderThickness="0" Margin="2,1,1,1" >x</Button>
<Button Grid.Row="3" Grid.Column="0" FontSize="18" BorderThickness="0" Margin="2,1,1,1" Background="WhiteSmoke">4</Button>
<Button Grid.Row="3" Grid.Column="1" FontSize="18" BorderThickness="0" Margin="2,1,1,1" Background="WhiteSmoke">5</Button>
<Button Grid.Row="3" Grid.Column="2" FontSize="18" BorderThickness="0" Margin="2,1,1,1" Background="WhiteSmoke">6</Button>
<Button Grid.Row="3" Grid.Column="3" FontSize="18" BorderThickness="0" Margin="2,1,1,1" >-</Button>
<Button Grid.Row="4" Grid.Column="0" FontSize="18" BorderThickness="0" Margin="2,1,1,1" Background="WhiteSmoke">1</Button>
<Button Grid.Row="4" Grid.Column="1" FontSize="18" BorderThickness="0" Margin="2,1,1,1" Background="WhiteSmoke">2</Button>
<Button Grid.Row="4" Grid.Column="2" FontSize="18" BorderThickness="0" Margin="2,1,1,1" Background="WhiteSmoke">3</Button>
<Button Grid.Row="4" Grid.Column="3" FontSize="18" BorderThickness="0" Margin="2,1,1,1" >+</Button>
<Button Grid.Row="5" Grid.Column="0" FontSize="18" BorderThickness="0" Margin="2,1,1,1" >±</Button>
<Button Grid.Row="5" Grid.Column="1" FontSize="18" BorderThickness="0" Margin="2,1,1,1" Background="WhiteSmoke">0</Button>
<Button Grid.Row="5" Grid.Column="2" FontSize="18" BorderThickness="0" Margin="2,1,1,1" >.</Button>
<Button Grid.Row="5" Grid.Column="3" FontSize="18" BorderThickness="0" Margin="2,1,1,1" >=</Button>
</Grid>
</DockPanel>
</Window>
반응형
'C# > C#200제' 카테고리의 다른 글
[C#] 22일차 - 164. WPF 디지털 시계 (0) | 2021.03.06 |
---|---|
[C#] 22일차 - 161. WinForm 윈도우 표준 계산기 (0) | 2021.03.05 |
[C#] 22일차 - 160. WPF 간단한 계산기 (0) | 2021.03.05 |
[C#] 21일차 - 159. WPF DispatcherTimer와 깜박이는 프로그램 (0) | 2021.03.01 |
[C#] 21일차 - 157. WPF의 레이아웃 (0) | 2021.03.01 |
@반나무 :: 반나무_뿌리
3년차 WPF 개발자입니다.
포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!