반응형
WPF에서 수직 탭 세트를 구축하는 방법은 무엇입니까?
WPF에서 수직 탭 세트를 구축하는 방법은 무엇입니까?탭은 비주얼 스튜디오에 표시된 프로젝트의 "속성"과 마찬가지로 위에서 아래로 쌓입니다.
속성을 사용해 보셨습니까?
다음 예제에서는 탭을 왼쪽에 배치하는 탭 컨트롤을 만듭니다.
<TabControl TabStripPlacement="Left" Margin="0, 0, 0, 10">
<TabItem Name="fontweight" Header="FontWeight">
<TabItem.Content>
<TextBlock TextWrapping="WrapWithOverflow">
FontWeight property information goes here.
</TextBlock>
</TabItem.Content>
</TabItem>
<TabItem Name="fontsize" Header="FontSize">
<TabItem.Content>
<TextBlock TextWrapping="WrapWithOverflow">
FontSize property information goes here.
</TextBlock>
</TabItem.Content>
</TabItem>
</TabControl>
다음 코드를 사용해 보십시오.
<TabControl.Resources>
<Style TargetType="{x:Type TabItem}">
<Setter Property="HeaderTemplate">
<Setter.Value>
<DataTemplate>
<ContentPresenter Content="{TemplateBinding Content}">
<ContentPresenter.LayoutTransform>
<RotateTransform Angle="270" />
</ContentPresenter.LayoutTransform>
</ContentPresenter>
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="Padding" Value="3" />
</Style>
</TabControl.Resources>
위의 rkirac의 답변에 근거합니다.글로벌 스타일을 만들고 싶지 않은 경우 동일한 내용을 내부에 넣을 수 있습니다.TabControl.ItemContainerStyle그것은 오직 영향을 미칠 것입니다.TabControl문제의다음은 간단한 예입니다.
<TabControl TabStripPlacement="Left">
<TabControl.ItemContainerStyle>
<Style TargetType="TabItem">
<Setter Property="LayoutTransform">
<Setter.Value>
<RotateTransform Angle="270" />
</Setter.Value>
</Setter>
</Style>
</TabControl.ItemContainerStyle>
</TabControl>
언급URL : https://stackoverflow.com/questions/3953286/how-to-build-vertical-tab-sets-in-wpf
반응형
'programing' 카테고리의 다른 글
| Git에서 로컬 커밋 삭제 (0) | 2023.05.01 |
|---|---|
| SQL Server Profiler - 추적을 필터링하여 한 데이터베이스의 이벤트만 표시하는 방법 (0) | 2023.05.01 |
| 어떻게 pip3를 업그레이드합니까? (0) | 2023.05.01 |
| 데이터와 함께 mongodb 데이터베이스 복사/클론 (0) | 2023.05.01 |
| 확인란과 해당 레이블을 일관되게 교차 브라우저에 정렬하는 방법 (0) | 2023.05.01 |