找回密码
 立即注册

QQ登录

只需一步,快速开始

xpholland88

注册会员

2

主题

6

帖子

52

积分

注册会员

积分
52
最新发帖
xpholland88
注册会员   /  发表于:2016-4-12 18:33  /   查看:3030  /  回复:3

想做成点击后下拉菜单的样子,竖直下来一列,但是现在用Content做的话下拉的内容无法被点击,要怎么改呢~




本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

3 个回复

倒序浏览
Alice
社区贡献组   /  发表于:2016-4-13 11:46:28
沙发
您想要的样式,可以参考随机安装示例,路径如下:
\Documents\ComponentOne Samples\WPF\C1.WPF.Toolbar\CS\ToolbarSamples

代码参考:
  1.                 <!-- Font -->
  2.                         <c1:C1ToolbarGroup Header="Font">
  3.                                 <c1:C1ToolbarStrip Overflow="None">
  4.                                         <ComboBox Width="100" Margin="0 0 4 0">
  5.                                                 <ComboBoxItem Content="default" IsSelected="True" />
  6.                                                 <ComboBoxItem Content="Arial" />
  7.                                                 <ComboBoxItem Content="Arial Black" />
  8.                                         </ComboBox>
  9.                                         <ComboBox Width="60" Margin="0">
  10.                                                 <ComboBoxItem Content="8" />
  11.                                                 <ComboBoxItem Content="9" />
  12.                                                 <ComboBoxItem Content="10" IsSelected="True" />
  13.                                                 <ComboBoxItem Content="12" />
  14.                                         </ComboBox>
  15.                                 </c1:C1ToolbarStrip>
  16.                                 <c1:C1ToolbarStrip Overflow="None">
  17.                                         <c1:C1ToolbarToggleButton>
  18.                                                 <Image Source="/ToolbarSamples.4;component/Resources/bold.png" Style="{StaticResource tbIcon}" />
  19.                                         </c1:C1ToolbarToggleButton>
  20.                                         <c1:C1ToolbarToggleButton>
  21.                                                 <Image Source="/ToolbarSamples.4;component/Resources/italic.png" Style="{StaticResource tbIcon}" />
  22.                                         </c1:C1ToolbarToggleButton>
  23.                                         <c1:C1ToolbarToggleButton>
  24.                                                 <Image Source="/ToolbarSamples.4;component/Resources/underline.png" Style="{StaticResource tbIcon}" />
  25.                                         </c1:C1ToolbarToggleButton>

  26.                                         <c1:C1Separator Style="{StaticResource tbSep}" />

  27.                                         <c1:C1ToolbarToggleButton>
  28.                                                 <Image Source="/ToolbarSamples.4;component/Resources/subscript.png" Style="{StaticResource tbIcon}" />
  29.                                         </c1:C1ToolbarToggleButton>
  30.                                         <c1:C1ToolbarToggleButton>
  31.                                                 <Image Source="/ToolbarSamples.4;component/Resources/superscript.png" Style="{StaticResource tbIcon}" />
  32.                                         </c1:C1ToolbarToggleButton>
  33.                                 </c1:C1ToolbarStrip>
  34.                                 <c1:C1ToolbarStrip Overflow="None">
  35.                                         <c1:C1ColorPicker Width="54" />
  36.                                 </c1:C1ToolbarStrip>
  37.                         </c1:C1ToolbarGroup>
复制代码
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
xpholland88
注册会员   /  发表于:2016-4-13 19:47:16
板凳
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?
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2016-4-14 10:46:28
地板
xpholland88 发表于 2016-4-13 19:47
额示例代码我都看了的,我想试试我那种用法的。。。就是那种下拉出现一列按钮的用法,求教~就是好像不能 ...

重现不了您提到的问题,在C1ToolbarDropDown.Content里添加C1ToolbarButton,Command可以正常执行。

在如下随机安装示例中做测试:
\Documents\ComponentOne Samples\WPF\C1.WPF.Toolbar\CS\ToolbarCommands\ToolbarCommandsCS

添加代码在示例的XAML中:
  1. <c1:C1ToolbarGroup Header="Test">
  2.                     <c1:C1ToolbarDropDown Header="Button" Width="60">
  3.                         <c1:C1ToolbarDropDown.Content>
  4.                             <c1:C1ToolbarButton Command="{StaticResource cmdPaste}"></c1:C1ToolbarButton>
  5.                         </c1:C1ToolbarDropDown.Content>
  6.                     </c1:C1ToolbarDropDown>
  7.                 </c1:C1ToolbarGroup>
复制代码

在运行时,打开Test组的Button下拉框,点击下拉框的按钮,可以正常触发Paste的命令。

请您根据示例检查自己的程序。
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部