DockPanel
s来指定几个文件。每个DockPanel都有一个文本框(用于路径)和一个按钮(用于浏览文件)。
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="150"
Height="22">
<DockPanel>
<TextBox HorizontalAlignment="Stretch"/> <!-- path to file -->
<Button Content="..." DockPanel.Dock="Right"/> <!-- button to browse for file -->
</DockPanel>
</Page>
LastChildFill="False"
HorizontalAlignment="Stretch"
我希望控件按此顺序排列的原因是我希望用户在使用时到达按钮前面的文本框
tab
在窗口中导航。我看了看布景
TabIndex
但WPF最受欢迎的特性是,tabindex是按照XAML中定义的控件的顺序排列的。更不用说我可能需要手动设置窗口中所有内容的TabIndex。
在我看来文本框.水平对齐不受尊重。
如何使第一个控件使用尽可能多的空间,但仍然保持选项卡顺序?