我正在使用WPF选项卡控件来呈现用户控件的单独重复实例.即Item1设置的Tab1,Item2设置的Tab2等.
似乎选项卡之间共享单选按钮组名称.到底是怎么回事?
简单的例子:
一个窗口包含选项卡.每个选项卡都包含用户控件.
<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:lib="clr-namespace:WpfApplication1"
Title="Window1" Height="300" Width="300">
<Grid>
<TabControl Margin="0,0,0,100" Name="tabControl1">
<TabItem Header="tabItem1" Name="tabItem1">
<lib:UserControl1 x:Name="userControlInTab1" />
</TabItem>
<TabItem Header="tabItem2" Name="tabItem2">
<lib:UserControl1 x:Name="userControlInTab2" />
</TabItem>
</TabControl>
</Grid>
Run Code Online (Sandbox Code Playgroud)
用户控件只是一组中的两个radiobuttons:
<UserControl x:Class="WpfApplication1.UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="50" Width="100">
<StackPanel>
<RadioButton GroupName="Group1" Name="radiobutton1" Content="option1" IsChecked="True" />
<RadioButton GroupName="Group1" Name="radiobutton2" Content="option2" />
</StackPanel>
Run Code Online (Sandbox Code Playgroud)
如果您运行此应用程序,您将看到只检查第二个选项卡中的radiobutton1,尽管用户控件定义它始终在启动时进行检查.
此外,在后面的代码中设置radiobutton似乎取消选中其他选项卡中的所有radiobutton!
看起来事情在鼠标控制下表现得很好(即标签是独立的).
最后,用户控件似乎确实是单独的实例.例如,我已尝试使用用户控件上的滑块,并且它们在标签之间的行为是独立的.他们应该这样做.
感谢任何人对此的帮助.我广泛搜索无济于事.当然,我不是唯一一个遇到过这个问题的人.我正在使用VS2008.
我有一个包含以下内容的HTML:
... some text ...
<a href="file.aspx?userId=123§ion=2">link</a> ... some text ...
... some text ...
<a href="file.aspx?section=5&user=678">link</a> ... some text ...
... some text ...
Run Code Online (Sandbox Code Playgroud)
我想解析它并获得与命名组的匹配:
比赛1
组[ "用户"] = 123
组[ "部分"] = 2
比赛2
组[ "用户"] = 678
组[ "部分"] = 5
如果参数总是按顺序排列,我可以这样做,首先是User,然后是Section,但是如果顺序不同,我不知道怎么做.
谢谢!
我是 R 的新手,我正在尝试创建一个显示甲虫库存的表格,其中物种按亚科分组。我已经弄清楚如何以一种我很高兴使用 gt 的 groupname_col 和 rowname_col 属性的方式设置表,但我在缩进方面遇到了困难。
现在,组名称下的项目仅缩进,看起来少于 1 个空格,这使得表格难以阅读,我如何将缩进更改为 ~4 个空格左右?
我怀疑我的代码在这里特别相关,但这是我创建表的行:
bt <- gt(beetledata, groupname_col = "Subfamily", rowname_col = "Species")%>%
opt_table_lines("none")%>%
tab_stubhead("Carabid species (subfamily)")%>%
cols_width(
1:2 ~ px(300),
everything() ~ px(100)
)%>%
cols_align(align="center", columns = -2);
Run Code Online (Sandbox Code Playgroud)
谢谢!
groupname ×3
formatting ×1
grouping ×1
gt ×1
query-string ×1
r ×1
radio-button ×1
regex ×1
tabcontrol ×1
wpf ×1