C#/C#200제

[C#] 22일차 - 163. WPF 윈도우 표준 계산기의 디자인

반나무 2021. 3. 6. 00:14
<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>

반응형