728x90
버튼을 둥글게 만들고 MouseOver 이벤트로 글자 크기 및 색상을 변경하고 싶다면
아래와 같은 xaml 코드를 입력하면 쉽게 변경이 가능합니다
<Button Content="Button" Background="SkyBlue" BorderThickness="0">
<Button.Resources>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="15" />
</Style>
<Style TargetType="{x:Type Button}">
<Setter Property="FontSize" Value="9" />
<Setter Property="Foreground" Value="Gray" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="FontSize" Value="12" />
<Setter Property="Foreground" Value="Black" />
</Trigger>
</Style.Triggers>
</Style>
</Button.Resources>
</Button>
위와 같이 입력하면 15만큼 라운딩 처리가 되고
기본 글자 크기가 9와 생상은 Gray 색으로 있다가
MouseOver 때는 글자 크기가 12와 색상은 Black 생상으로 변경이 됩니다
제 글이 도움이 되셨다면 댓글 & 공감 부탁드려요 😀
728x90
'Application > C# (WPF)' 카테고리의 다른 글
[C# WPF] 파일명 & 버전 가져오기 (0) | 2023.01.26 |
---|---|
[C# WPF] 스피커 & 마이크 설정하기 (2) | 2023.01.25 |
[C# WPF] GIF 파일 재생하기 (MediaElement) (0) | 2023.01.18 |
[C# WPF] Background 이미지 설정하기 (0) | 2023.01.17 |
[C# WPF] 이미지 화질 개선 (Bitmap 화질 높이기) (0) | 2023.01.16 |