xaml

        <Button x:Name="g_1" HorizontalAlignment="Left" Height="100" Margin="220,27,0,0" VerticalAlignment="Top" Width="90" Background="Black" Foreground="Lime" Content="1" FontSize="36" Click="btn_ClickL" MouseRightButtonDown="btn_ClickR"/>
        <Button x:Name="g_2" HorizontalAlignment="Left" Height="100" Margin="340,27,0,0" VerticalAlignment="Top" Width="90" Background="Black" Foreground="Lime" Content="1" FontSize="36" Click="btn_ClickL" MouseRightButtonDown="btn_ClickR"/>
        <Button x:Name="g_3" HorizontalAlignment="Left" Height="100" Margin="460,27,0,0" VerticalAlignment="Top" Width="90" Background="Black" Foreground="Lime" Content="1" FontSize="36" Click="btn_ClickL" MouseRightButtonDown="btn_ClickR"/>
        <Button x:Name="g_4" HorizontalAlignment="Left" Height="100" Margin="580,27,0,0"  VerticalAlignment="Top" Width="90" Background="Black" Foreground="Lime" Content="1" FontSize="36" Click="btn_ClickL" MouseRightButtonDown="btn_ClickR"/> 

C# 코드

 

- xaml

        <ToggleButton x:Name="move1_g" Content="1" HorizontalAlignment="Left" Margin="15,50,0,0" VerticalAlignment="Top" Width="43" Height="65" FontSize="36" BorderBrush="White" Background="Black" Foreground="White" Checked="move1_g_Checked"/>
        <ToggleButton x:Name="move2_g" Content="2" HorizontalAlignment="Left" Margin="65,50,0,0" VerticalAlignment="Top" Width="43" Height="65" FontSize="36" Background="Black" BorderBrush="White" Foreground="White" Checked="move2_g_Checked"/>
        <ToggleButton x:Name="move3_g" Content="3" HorizontalAlignment="Left" Margin="115,50,0,0" VerticalAlignment="Top" Width="43" Height="65" FontSize="36" Background="Black" BorderBrush="White" Foreground="White" Checked="move3_g_Checked"/>
        <ToggleButton x:Name="move4_g" Content="4" HorizontalAlignment="Left" Margin="165,50,0,0" VerticalAlignment="Top" Width="43" Height="65" FontSize="36" Background="Black" BorderBrush="White" Foreground="White" Checked="move4_g_Checked"/>
        <Button x:Name="ok_g" Content="MOVE" HorizontalAlignment="Left" Margin="220,50,0,0" VerticalAlignment="Top" Width="50" RenderTransformOrigin="-0.288,1.109" Height="65" Background="White" Foreground="Black" BorderBrush="Black" Click="ok_g_Click" FontWeight="Bold" />

 

- c# code

 

 

-  result

 

<Title="xaml_code" Height="200" Width="300" MinHeight="200" MinWidth="300" MaxHeight="400" MaxWidth="600">

MinWidth : 윈도우의 최소 너비

MinHeight : 윈도우의 최소 높이

MaxWidth : 윈도우의 최대 너비

MaxHeight : 윈도우의 최대 높이

- MinWidth와 MaxWidth를 같은 값으로 지정하면 윈도우의 너비가 고정이 된다.

- MinHeight와 MaxHeight를 같은 값으로 지정하면 윈도우의 높이가 고정이 된다.

1. 프로젝트에 아이콘 파일 (.ico) 추가하기


2. xaml에 Icon 추가하기

        Title="ASCII Code v.1.0.0" Height="200" Width="400" Background="Black" Icon="ascii.ico">


3. 프로젝트 Properties ->Application -> Resources -> Icon and manifest 에 Icon 변경하기


+ Recent posts