关于ToolBar下拉键的使用
想做成点击后下拉菜单的样子,竖直下来一列,但是现在用Content做的话下拉的内容无法被点击,要怎么改呢~
您想要的样式,可以参考随机安装示例,路径如下:
\Documents\ComponentOne Samples\WPF\C1.WPF.Toolbar\CS\ToolbarSamples
代码参考:
<!-- Font -->
<c1:C1ToolbarGroup Header="Font">
<c1:C1ToolbarStrip Overflow="None">
<ComboBox Width="100" Margin="0 0 4 0">
<ComboBoxItem Content="default" IsSelected="True" />
<ComboBoxItem Content="Arial" />
<ComboBoxItem Content="Arial Black" />
</ComboBox>
<ComboBox Width="60" Margin="0">
<ComboBoxItem Content="8" />
<ComboBoxItem Content="9" />
<ComboBoxItem Content="10" IsSelected="True" />
<ComboBoxItem Content="12" />
</ComboBox>
</c1:C1ToolbarStrip>
<c1:C1ToolbarStrip Overflow="None">
<c1:C1ToolbarToggleButton>
<Image Source="/ToolbarSamples.4;component/Resources/bold.png" Style="{StaticResource tbIcon}" />
</c1:C1ToolbarToggleButton>
<c1:C1ToolbarToggleButton>
<Image Source="/ToolbarSamples.4;component/Resources/italic.png" Style="{StaticResource tbIcon}" />
</c1:C1ToolbarToggleButton>
<c1:C1ToolbarToggleButton>
<Image Source="/ToolbarSamples.4;component/Resources/underline.png" Style="{StaticResource tbIcon}" />
</c1:C1ToolbarToggleButton>
<c1:C1Separator Style="{StaticResource tbSep}" />
<c1:C1ToolbarToggleButton>
<Image Source="/ToolbarSamples.4;component/Resources/subscript.png" Style="{StaticResource tbIcon}" />
</c1:C1ToolbarToggleButton>
<c1:C1ToolbarToggleButton>
<Image Source="/ToolbarSamples.4;component/Resources/superscript.png" Style="{StaticResource tbIcon}" />
</c1:C1ToolbarToggleButton>
</c1:C1ToolbarStrip>
<c1:C1ToolbarStrip Overflow="None">
<c1:C1ColorPicker Width="54" />
</c1:C1ToolbarStrip>
</c1:C1ToolbarGroup> Alice 发表于 2016-4-13 11:46
您想要的样式,可以参考随机安装示例,路径如下:
\Documents\ComponentOne Samples\WPF\C1.WPF.Toolbar\C ...
额示例代码我都看了的,我想试试我那种用法的。。。就是那种下拉出现一列按钮的用法,求教~就是好像不能在Content里面写,否则下拉按钮就无法点击了。那样怎么办?
The amount of sample code I have read, I would like to try my kind of usage... Is that the drop-down appears the usage of a column of buttons, ask for advice ~ it seems not in the content inside write or drop-down button to click. What about that? xpholland88 发表于 2016-4-13 19:47
额示例代码我都看了的,我想试试我那种用法的。。。就是那种下拉出现一列按钮的用法,求教~就是好像不能 ...
重现不了您提到的问题,在C1ToolbarDropDown.Content里添加C1ToolbarButton,Command可以正常执行。
在如下随机安装示例中做测试:
\Documents\ComponentOne Samples\WPF\C1.WPF.Toolbar\CS\ToolbarCommands\ToolbarCommandsCS
添加代码在示例的XAML中:
<c1:C1ToolbarGroup Header="Test">
<c1:C1ToolbarDropDown Header="Button" Width="60">
<c1:C1ToolbarDropDown.Content>
<c1:C1ToolbarButton Command="{StaticResource cmdPaste}"></c1:C1ToolbarButton>
</c1:C1ToolbarDropDown.Content>
</c1:C1ToolbarDropDown>
</c1:C1ToolbarGroup>
在运行时,打开Test组的Button下拉框,点击下拉框的按钮,可以正常触发Paste的命令。
请您根据示例检查自己的程序。
页:
[1]