前台设置:
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WPF123"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" x:Class="WPF123.MainWindow"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
<Grid>
<dx:DXTabControl Margin="18,23,37,47" Name="hahahha">
<dx:DXTabControl.View>
<dx:TabControlMultiLineView HeaderLocation="Top"></dx:TabControlMultiLineView>
</dx:DXTabControl.View>
<dx:DXTabItem Header="123">
<Grid Background="AliceBlue">
<Button Height="22" Content="123"></Button>
</Grid>
</dx:DXTabItem>
<dx:DXTabItem Header="456">
<Grid Background="AliceBlue">
<Button Height="22" Content="456"></Button>
</Grid>
</dx:DXTabItem>
<dx:DXTabItem Header="789">
<Grid Background="AliceBlue">
<Button Height="22" Content="789"></Button>
</Grid>
</dx:DXTabItem>
</dx:DXTabControl>
</Grid>
</Window>
dx:TabControlMultiLineView HeaderLocation="Top”,top向上显示,right 靠右显示,none不显示
后台代码设置:
.View.HeaderLocation = DevExpress.Xpf.Core.HeaderLocation.None;
注:
namespace DevExpress.Xpf.Core
{
//
// 摘要:
// Lists values that specify the location of the Header Panel, relative to the tab
// item.
public enum HeaderLocation
{
//
// 摘要:
// The Header Panel is not displayed.
None = 0,
//
// 摘要:
// The Header Panel is located on the left side of the tab item.
Left = 1,
//
// 摘要:
// The Header Panel is located at the top of the tab item.
Top = 2,
//
// 摘要:
// The Header Panel is located on the right side of the tab item.
Right = 3,
//
// 摘要:
// The Header Panel is located at the bottom of the tab item.
Bottom = 4
}
}