소스 및 필기는 아래 파일 참고.
01_WPF_start.pdf
0.88MB
02_WPF_application_generation.pdf
1.40MB
ex) StackPanel에 여러 도구 추가해보기
<Window x:Class="WpfApp1.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:WpfApp1"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<StackPanel Orientation="Vertical"> <!-- 스택패널 시작 -->
<TextBlock Width="100" Height="40" Text="TextBlock"/>
<TextBox Width="100" Height="35" Text = "TextBox"/>
<ProgressBar Width="100" Height="20" Value="20" Minimum="0" Maximum="100"/>
<Slider Width="100" Height="30" Value="10" Maximum="100"/>
<PasswordBox Password="Plan" Width="100" Height="30"/>
</StackPanel>
</Window>
ex) 사진, 동영상
<Window x:Class="WpfControlApp.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:WpfControlApp"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<Image HorizontalAlignment="Left" Height="240" Margin="519,86,0,0" VerticalAlignment="Top" Width="243" Source="cat.jpg" Stretch="UniformToFill"/>
<MediaElement HorizontalAlignment="Left" Height="265" Margin="28,61,0,0" VerticalAlignment="Top" Width="491" Source="cat.wmv" LoadedBehavior="Play"/>
</Grid>
</Window>
ex) 사각형, 원
<Window x:Class="WpfControlApp.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:WpfControlApp"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<Rectangle Fill="#FFDB3EE8" HorizontalAlignment="Left" Height="138" Margin="185,110,0,0" Stroke="Black" VerticalAlignment="Top" Width="150" RadiusY="20" RadiusX="20"/>
<Ellipse Fill="#FFDB3EE8" HorizontalAlignment="Left" Height="138" Margin="472,110,0,0" Stroke="Black" VerticalAlignment="Top" Width="138"/>
</Grid>
</Window>
ex) 버튼, 라디오버튼, 체크박스
<Window x:Class="WpfControlApp.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:WpfControlApp"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<Button Content="Button" HorizontalAlignment="Left" Margin="61,63,0,0" VerticalAlignment="Top" Width="95" Height="43"/>
<ToggleButton Content="Button" HorizontalAlignment="Left" Margin="176,63,0,0" VerticalAlignment="Top" Width="95" Height="43"/>
<CheckBox Content="CheckBox" HorizontalAlignment="Left" Margin="61,137,0,0" VerticalAlignment="Top"/>
<RadioButton Content="RadioButton" HorizontalAlignment="Left" Margin="61,187,0,0" VerticalAlignment="Top"/>
</Grid>
</Window>
'스마트팩토리 > C# 데스크톱 앱(윈폼),WPF' 카테고리의 다른 글
9. MaskedTextBox (0) | 2020.08.20 |
---|---|
8. WPF (0) | 2020.06.24 |
6. 윈폼 - DB 연동(책 대출 프로그램) 완성 (0) | 2020.06.22 |
[정리] 윈폼 - DB 연동 (최종본) (0) | 2020.06.20 |
5. 윈폼 - DB연동 (0) | 2020.06.19 |