WPF ToolTip 기본 컨트롤 스타일 재정의 하는 방법
Code/C#2019. 3. 28. 08:40
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | <UserControl.Resources> <Style x:Key="CustomToolTip" TargetType="{x:Type ToolTip}" BasedOn="{StaticResource {x:Type ToolTip}}"> <Setter Property="FontSize" Value="9"/> <Setter Property="FontFamily" Value="Noto Sans Light"/> <Setter Property="Foreground" Value="#ffffff"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ToolTip}" > <Grid Height="30"> <Viewbox Stretch="Fill" > <Path Data="M 1.5,0 L 3,3 0,3 Z" Width="3" Height="5" Fill="#FF6D6E71" /> </Viewbox> <Border Background="#6d6e71" CornerRadius="10" Height="20"> <Grid VerticalAlignment="Center"> <Grid.ColumnDefinitions> <ColumnDefinition Width="8"/> <ColumnDefinition Width="1*"/> <ColumnDefinition Width="8"/> </Grid.ColumnDefinitions> <ContentPresenter Grid.Column="1" ContentSource="{Binding}"/> </Grid> </Border> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> </UserControl.Resources> | cs |
'Code > C#' 카테고리의 다른 글
WPF CheckBox 색 바꾸는 방법 (0) | 2019.04.07 |
---|---|
WPF 배경이 없는 이미지 버튼 만들기(Hover 배경색 변경가능) (0) | 2019.03.28 |
WPF Combobox 선택 이벤트, old 값이 나올때 (0) | 2019.03.19 |
WPF C#으로 UserControll을 바로 다이얼로그 화면으로 출력 하고 싶을때 (0) | 2019.03.12 |
WPF XAML로 다른 클래스 라이브러리에 있는 xaml 참조하는 방법 (0) | 2019.03.12 |