1. xaml
1-(1) xaml 소스 코드
<Window x:Class="cal.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:cal"
mc:Ignorable="d"
Title="MainWindow" Height="628.153" Width="406.745">
<Grid HorizontalAlignment="Left" Width="404" Margin="0,0,-5,-1">
<Grid.RowDefinitions>
<RowDefinition Height="200"/>
<RowDefinition Height="75"/>
<RowDefinition Height="75"/>
<RowDefinition Height="75"/>
<RowDefinition Height="75"/>
<RowDefinition Height="75"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<Label Content="0"
x:Name="resultLabel"
Grid.ColumnSpan="4"
Grid.Row="0"
HorizontalContentAlignment="Right"
VerticalContentAlignment="Bottom"
FontSize="100"/>
<Button Grid.Column="0"
Grid.Row="1"
Content="AC"
FontSize="30"
Margin="5,5,5,5"/>
<Button Grid.Column="1"
Grid.Row="1"
Content="+/-"
FontSize="30"
Margin="5,5,5,5"/>
<Button Grid.Column="2"
Grid.Row="1"
Content="%"
FontSize="30"
Margin="5,5,5,5"/>
<Button Grid.Column="3"
Grid.Row="1"
Content="/"
Background="Green"
Margin="5,5,5,5"
FontSize="30"/>
<Button Grid.Column="0"
Grid.Row="2"
Content="7"
Foreground="white"
Background="Gray"
Margin="5,5,5,5"
FontSize="30"/>
<Button Grid.Column="1"
Grid.Row="2"
Content="8"
Foreground="white"
Background="Gray"
FontSize="30"
Margin="5,5,5,5"/>
<Button Grid.Column="2"
Grid.Row="2"
Content="9"
Foreground="white"
Background="Gray"
Margin="5,5,5,5"
FontSize="30"/>
<Button Grid.Column="3"
Grid.Row="2"
Content="*"
Background="Green"
Margin="5,5,5,5"
FontSize="30"/>
<Button Grid.Column="0"
Grid.Row="3"
Content="4"
Foreground="white"
Background="Gray"
Margin="5,5,5,5"
FontSize="30"/>
<Button Grid.Column="1"
Grid.Row="3"
Content="5"
Foreground="white"
Background="Gray"
Margin="5,5,5,5"
FontSize="30"/>
<Button Grid.Column="2"
Grid.Row="3"
Content="6"
Foreground="white"
Background="Gray"
Margin="5,5,5,5"
FontSize="30"/>
<Button Grid.Column="3"
Grid.Row="3"
Content="-"
Background="Green"
Margin="5,5,5,5"
FontSize="30"/>
<Button Grid.Column="0"
Grid.Row="4"
Content="1"
Foreground="white"
Background="Gray"
Margin="5,5,5,5"
FontSize="30"/>
<Button Grid.Column="1"
Grid.Row="4"
Content="2"
Foreground="white"
Background="Gray"
Margin="5,5,5,5"
FontSize="30"/>
<Button Grid.Column="2"
Grid.Row="4"
Content="3"
Foreground="white"
Background="Gray"
Margin="5,5,5,5"
FontSize="30"/>
<Button Grid.Column="3"
Grid.Row="4"
Content="+"
Background="Green"
Margin="5,5,5,5"
FontSize="30"/>
<Button Grid.Column="0"
Grid.Row="5"
Content="0"
Margin="5,5,5,-13"
Grid.ColumnSpan="2"
Foreground="white"
Background="Gray"
FontSize="30"/>
<Button Grid.Column="2"
Grid.Row="5"
Content="."
Foreground="white"
Background="Gray"
FontSize="30"
Margin="5,5,5,-13"/>
<Button Grid.Column="3"
Grid.Row="5"
Content="="
Background="Green"
Margin="5,5,5,-13"
FontSize="30"/>
</Grid>
</Window>
2. 수정해야 할 사항
1) 코드가 너무 하드해서, 각 버튼별로 정리가 필요함
2) 다음 게시 전까지 코드를 정리하여 올릴 예정
'Language > C# WPF Programming' 카테고리의 다른 글
C# WPF 프로그래밍 메뉴(Menu) 아이템 컨트롤 구현하기 (0) | 2019.04.17 |
---|---|
C# WPF 프로그래밍 아이템 컨트롤 리스트 박스(list box)구현 (0) | 2019.04.16 |
C# WPF 프로그래밍 계산기 프로그램 만들기(Calculator) - 3(xaml 코드 수정 및 이벤트 함수 수정) (0) | 2019.04.12 |
C# WPF 프로그래밍 계산기 프로그램 만들기(Calculator) - 2(xaml 코드 정리 및 이벤트 함수 생성 2가지) (0) | 2019.04.11 |
C# WPF 프로그래밍 label과 TextBlock (0) | 2019.04.09 |
C# WPF 프로그래밍 Radio Button 이벤트 (0) | 2019.04.08 |
C# WPF 프로그래밍 토글 버튼 이벤트 컨트롤 (1) | 2019.04.05 |
C# WPF 프로그래밍 버튼 이벤트 컨트롤 (0) | 2019.04.04 |
최근댓글