找回密码
 立即注册

QQ登录

只需一步,快速开始

anyone2012

注册会员

2

主题

15

帖子

31

积分

注册会员

积分
31

活字格认证

最新发帖
anyone2012
注册会员   /  发表于:2012-3-30 14:12  /   查看:14242  /  回复:24
用C1.Win.Command.dll制作工具条,如果通过代码调整toolbar的排列,当窗口改变大小时,将会恢复到原来的状态,但如果是用鼠标拖动来调整,则可以保存调整后的状态。本附件中附有代码说明,双击c1CommandDock使toolbar调整好排列,但一调整窗口大小,toolbar又恢复到原来的样子了

本帖子中包含更多资源

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

x

24 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2012-3-30 14:26:00
沙发

回复 1# anyone2012 的帖子

anyone2012 你好,
问题我们已经接收,正在处理中,稍后回复。
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2012-3-30 15:20:00
板凳

回复 1# anyone2012 的帖子

anyone2012  你好,
请问这个 Case 要实现的功能是把两个 ToolBar Dock 到 C1CommandHolder 左侧吗?请使用以下代码测试:
  1. this.c1CommandDock1.SuspendLayout();
  2.             this.c1ToolBar2.SuspendLayout();
  3.             this.c1ToolBar1.Location = new Point(3, 0);
  4.             this.c1ToolBar2.Location = new Point(this.c1ToolBar1.Width + 3, 0);
  5.             this.c1ToolBar2.ResumeLayout(false);
  6.             this.c1CommandDock1.ResumeLayout(false);
复制代码
回复 使用道具 举报
anyone2012
注册会员   /  发表于:2012-3-30 15:37:00
地板
将c1ToolBar2排到c1ToolBar1的后面
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2012-3-30 16:17:00
5#

回复 4# anyone2012 的帖子

anyone2012 你好,

捕捉 Form 的 Resize 事件,添加排列代码,实现c1ToolBar2排到c1ToolBar1的后面
  1.       
  2.   private void frmSP1_Resize(object sender, EventArgs e)
  3.         {
  4.             this.c1CommandDock1.SuspendLayout();
  5.             this.c1ToolBar2.SuspendLayout();
  6.             this.c1ToolBar1.Location = new Point(3, 0);
  7.             //this.c1ToolBar2.Location = new Point(this.c1ToolBar1.Location.X+this.c1ToolBar1.Width + 3, this.c1ToolBar1.Location.Y);


  8.             Point pt = this.c1CommandDock1.PointToScreen(new Point(this.c1ToolBar1.Right + 3, 0));
  9.             this.c1CommandDock1.DockOrFloatChild(this.c1ToolBar2, pt);
  10.             this.c1ToolBar2.SetBounds(this.c1ToolBar2.Location.X, this.c1ToolBar2.Location.Y, this.c1ToolBar2.Size.Width, this.c1ToolBar2.Size.Height);
  11.             this.c1ToolBar2.ResumeLayout(false);
  12.             this.c1CommandDock1.ResumeLayout(false);
  13.         }
复制代码
回复 使用道具 举报
anyone2012
注册会员   /  发表于:2012-3-30 16:41:00
6#
这样做不行的,因为toolbar是用户随时会拖动位置的
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2012-3-30 18:07:00
7#

回复 6# anyone2012 的帖子

anyone2012 你好,
请问 2# 中的代码是否可以满足需求?
回复 使用道具 举报
anyone2012
注册会员   /  发表于:2012-3-30 21:50:00
8#
肯定不行的,而且这样会大大降低程序效率
回复 使用道具 举报
anyone2012
注册会员   /  发表于:2012-3-31 08:29:00
9#
前面的做法不能解决问题,另外当窗口的宽度小于toolbar1与toolbar2的宽度时,toolbar2会折到下一行,视觉很不好
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2012-3-31 08:42:00
10#

回复 9# anyone2012 的帖子

anyone2012 早上好,
你的问题我们正在处理中,稍后回复
回复 使用道具 举报
123下一页
您需要登录后才可以回帖 登录 | 立即注册
返回顶部