- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 ItemsControl 的 DataTemplate 中设置了一个 DockPanel,如下所示:
<ItemsControl HorizontalContentAlignment="Stretch">
<ItemsControl.ItemTemplate>
<DataTemplate>
<DockPanel>
<ComboBox DockPanel.Dock="Left"/>
<ComboBox DockPanel.Dock="Left"/>
<Button DockPanel.Dock="Right">Button</Button>
<!-- This will appear before the button...it has to go after it in the XAML so it will fill properly in the DockPanel -->
<TextBox DockPanel.Dock="Left" MinWidth="100" HorizontalAlignment="Stretch"/>
</DockPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
KeyboardNavigation.TabIndex
每个项目的属性,但由于这是 ItemsControl 的 DataTemplate (这些停靠面板中的每一个都将用于一个单独的项目),这使得选项卡顺序垂直向下跳到每个项目的组合框,然后垂直向下跳到每个文本框,然后垂直按下每个按钮,而不是遍历每一行,然后按下所需的行为。
[Combo11] [Combo12] [Text1] [Button1]
[Combo21] [Combo22] [Text2] [Button2]
Combo11,Combo12,Button1,Text1,Combo21,Combo22,Button2,Text2
.如果我添加 TabOrder 属性,它将变为
Combo11,Combo21,Combo12,Combo22,Text1,Text2,Button1,Button2
.
Combo11,Combo12,Text1,Button1,Combo21,Combo22,Text2,Button2
.
最佳答案
如果要保留 DockPanel,可以在父 DockPanel 上使用 KeyboardNavigation.TabNavigation="Local",然后可以在其中的控件上设置选项卡索引值。
像这样 -
<ItemsControl HorizontalContentAlignment="Stretch">
<ItemsControl.ItemTemplate>
<DataTemplate>
<DockPanel KeyboardNavigation.TabNavigation="Local">
<ComboBox DockPanel.Dock="Left" TabIndex="1"/>
<ComboBox DockPanel.Dock="Left" TabIndex="2"/>
<Button DockPanel.Dock="Right" TabIndex="4">Button</Button>
<!-- This will appear before the button...it has to go after it in the XAML so it will fill properly in the DockPanel -->
<TextBox DockPanel.Dock="Left" MinWidth="100" HorizontalAlignment="Stretch" TabIndex="3"/>
</DockPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
关于wpf - DockPanel 选项卡顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3549678/
在我的 GWT 应用程序中,我使用了一个停靠面板,其中 DockPanel.NORTH 是一个 MenuBar 组件,实现了我的导航栏,而 中的组件DockPanel.CENTER位置根据导航栏中选择
我知道 DockPanel 子元素的顺序很重要。我在某处读到, child 的布局是根据所有先前的 child 都已经定位后剩下的可用空间来确定的。因此,例如对于这段代码: 我
我有这个代码,我在 Button.Content 上使用了 DockPanel。但是它不允许我正确对齐最后一个图像(小箭头)。
// error here 以上是我的停靠面板 xmal 代码。因为 Is
我在 ItemsControl 的 DataTemplate 中设置了一个 DockPanel,如下所示: Butt
如何以编程方式创建基于 UserControl 的元素并将其停靠到 DockPanel? 最佳答案 var myControl = new MyUserControl(); DockPanel.Set
在我的窗口中,有一个 DockPanel 列表来指定几个文件。每个 DockPanel 都有一个文本框(用于路径)和一个按钮(用于浏览文件)。 我重新创建了一个简单的 WPF 页面来演示此处的问题:
我有这个 .xaml 代码:
我在 Dock panel 中滚动内容时遇到问题。 我的控件放置在“DockPanel”中,如下所示 我只使用垂直滚动条,不需要水平滚动条, 当我第一次使用 tab
我有一个 DockPanel,我正在以编程方式向其中添加 TextBlock 控件。 DockPanel 定义如下: TextBlocks 添加到 DockPanel 如下: For
我正在尝试 ItemsControl(ListBox) 中的购物车内容.为此,我创建了以下 DataTemplate : 但是,当商品显示在
我的应用程序有一种磁贴系统。请看下面的代码:
我正在尝试将 wpf 中的 Dockpanel 数据绑定(bind)到 View 模型集合。我正在使用它来创建可自定义的表单,因此在运行时之前我不知道停靠面板中应该有多少个 child 。 我遇到的问
我正在学习 WPF,并试图拥有一个由顶部工具栏和底部状态栏组成的表单,其余部分将由用于数据输入的控件占据。 这是我目前所拥有的:
我正在尝试在 ListView 数据模板中创建一个停靠面板,该模板占用其父选项卡控件的所有可用宽度。我首先将我的 XAML 基于 this question因此想出了这个:
我希望 4 个按钮(通知、打印机、三个点和浅色/深色主题按钮)位于窗口的右侧,而 Humburger 按钮和 TextBox 应保留在左侧,这将使我们的中间部分留空。 XAML:
我有一个对象列表。我正在使用 WeifenLuo DockPanel Suite 在不同的窗口中显示列表中的每个对象。我希望能够在 dockPanel 中设置事件窗口,以便事件窗口成为我在对象列表中选
这个问题在这里已经有了答案: Is it possible to style the contents of a DockPanel to fill the last *visible* child
我的观点是——正如我在 WeifenLuo DockPanel 套件示例中看到的——那里只使用了 MDI 环境。 但是如果我想在子表单中使用停靠,可以吗? 最佳答案 在示例应用程序中,您将看到可用的停
我想知道是否可以重现与 WPF 中的 DockPanel 相同的行为,但在 UWP 应用程序中? 我想停靠一些容器,最后一个填充用户界面? 谢谢 最佳答案 我会推荐 RelativePanel .它并
我是一名优秀的程序员,十分优秀!