728x90
반응형
728x170
▶ MainWindow.xaml
<Window x:Class="TestProject.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="800"
Height="600"
Title="ListBox 엘리먼트 : 마우스 진입시 애니메이션 사용하기"
FontFamily="나눔고딕코딩"
FontSize="16">
<Grid>
<StackPanel
HorizontalAlignment="Center"
VerticalAlignment="Center">
<ListBox Name="listBox"
HorizontalAlignment="Center"
Width="200"
Height="300">
<ListBox.Style>
<Style TargetType="ListBox">
<Style.Triggers>
<EventTrigger RoutedEvent="MouseEnter">
<BeginStoryboard>
<Storyboard AutoReverse="True">
<DoubleAnimation
Storyboard.TargetProperty="Opacity"
Duration="00:00:01"
From="1"
To="0" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Style.Triggers>
</Style>
</ListBox.Style>
</ListBox>
<Button Name="addButton"
HorizontalAlignment="Right"
Margin="0 10 0 0"
Width="100"
Height="30"
Content="항목 추가" />
</StackPanel>
</Grid>
</Window>
728x90
반응형
그리드형(광고전용)
'C# > WPF' 카테고리의 다른 글
[C#/WPF] Dispatcher 클래스 : Invoke 메소드를 사용해 UI 업데이트 하기 (0) | 2021.04.22 |
---|---|
[C#/WPF] 관리자 권한으로 실행하기 (0) | 2021.04.03 |
[C#/WPF] 가상 키보드 사용하기 (0) | 2021.03.27 |
[C#/WPF] HTML을 XAML로 변환하기 (0) | 2021.03.20 |
[C#/WPF] LogicalTreeHelper 클래스 : GetChildren 정적 메소드를 사용해 논리적 자식 열거 가능형 구하기 (0) | 2021.03.20 |
[C#/WPF] ListBox 클래스 : 항목 선택시 슬라이딩 리스트 박스 사용하기 (0) | 2021.03.07 |
[C#/WPF] 누겟 설치 : VirtualDesktop.WPF (0) | 2021.03.06 |
[C#/WPF] SystemParameters 클래스 : VirtualScreenWidth/VirtualScreenHeight 정적 속성을 사용해 듀얼 모니터 전체 화면 윈도우 표시하기 (0) | 2021.03.06 |
[C#/WPF] Screen 클래스 : AllScreens 정적 속성을 사용해 듀얼 모니터 전체 화면 윈도우 표시하기 (0) | 2021.03.06 |
[C#/WPF] DataTemplate 엘리먼트 : Label 엘리먼트의 ContentTemplate 속성 설정하기 (0) | 2021.03.04 |
댓글을 달아 주세요