vs2008 c# 浮动工具栏 急!

daredjever 2010-04-23 11:48:49
大家好:
开贴求助。
问题描述:工具:vs2008,语言:c#,功能:制作可浮动的工具栏。

上网搜了一下没什么眉目,请大家帮帮忙,不管是代码实现还是第三方控件都行。
...全文
962 25 打赏 收藏 转发到动态 举报
写回复
用AI写文章
25 条回复
切换为时间正序
请发表友善的回复…
发表回复
cao__tia 2011-02-26
  • 打赏
  • 举报
回复
真是 不错 找好久了 谢谢!
dongwei381 2010-08-10
  • 打赏
  • 举报
回复
hao 东东
daredjever 2010-04-26
  • 打赏
  • 举报
回复
我把这些都导入我内网的机器实际实践下吧,谢谢你的分享了。
捷哥1999 2010-04-26
  • 打赏
  • 举报
回复
是的,那个库,我也有提供了源代码呀。
对于dispose的委托,我是写了预防代码的,我在ToolStripFloatWindow写了

private void ToolStripFloatWindow_Load(object sender, EventArgs e)
{
this.hasCreated = true;
}


然后在FloatToolstrip中,判断是否要销毁ToolStripFloatWindow,刚开始我遇到过你这个委托,然后我加了这个处理,就再也没有遇到过。

if (floatForm.HasCreated)
{
Point currentPt = new Point(floatForm.Location.X, floatForm.Location.Y);
Point minPt = this.tsPanel.PointToScreen(tsPanel.Location);
Point maxPt;
if (this.tsPanel.Height <= 20)
{
maxPt = new Point(minPt.X + this.tsPanel.Width, minPt.Y + 20);

}
else
{
maxPt = new Point(minPt.X + this.tsPanel.Width, minPt.Y + this.tsPanel.Height);
}

if ((currentPt.X > minPt.X) && (currentPt.X < maxPt.X) && (currentPt.Y > minPt.Y - 25) && (currentPt.Y < maxPt.Y - 25))
{
this.floatForm.Controls.Remove(this);
this.tsPanel.SuspendLayout();
this.tsPanel.Controls.Add(this);
this.Location = this.tsPanel.PointToClient(currentPt);
this.tsPanel.ResumeLayout();
this.floatForm.Dispose();
this.floatForm = null;
}
}
hongqun369 2010-04-26
  • 打赏
  • 举报
回复
学习。。
daredjever 2010-04-26
  • 打赏
  • 举报
回复
还有请问你Com.ajieStudio.dll这个库对于工具栏的浮动是必须的吗?FloatToolstrip.Designer.cs这个文件也是自己写的?
daredjever 2010-04-26
  • 打赏
  • 举报
回复
[Quote=引用 18 楼 computerfox 的回复:]

http://download.csdn.net/source/2276444
这个我测试了,没有问题的呀,你那边运行出现什么问题,告诉我,我看看。
[/Quote]

异常被捕捉抛出的。好像是关于dispose窗体的。我再试试。
还有请问如果想让浮动的工具栏不能超出主界面的范围,该怎么处理
捷哥1999 2010-04-26
  • 打赏
  • 举报
回复
http://download.csdn.net/source/2276444
这个我测试了,没有问题的呀,你那边运行出现什么问题,告诉我,我看看。
daredjever 2010-04-26
  • 打赏
  • 举报
回复
[Quote=引用 11 楼 wuyq11 的回复:]

http://topic.csdn.net/u/20100302/14/605832e2-00fe-494d-be29-2e296d99c9d1.html?73134
[/Quote]

你好,你提供的这个是替他窗口的关于DOCKing的使用,其工具栏也是不可拖动成浮动窗口的。
大家提到的weifenluo.winformsui.docking.dll这个库,他有没有提供浮动工具栏的功能?就是工具栏可以浮动在任意窗口中任意位置。
daredjever 2010-04-26
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 computerfox 的回复:]

http://download.csdn.net/source/2276444

看看我刚刚实现的这个吧,包含源代码,简单易用!
[/Quote]

你好:谢谢你的代码,不过似乎运行时有bug,拖动过程中会报出异常。我再看看代码。谢谢分享
qshurufa 2010-04-23
  • 打赏
  • 举报
回复
夏脑 2010-04-23
  • 打赏
  • 举报
回复
先在主窗口作好toolstrip,要浮动时将Parent设为新的窗口,同时调整窗口大小.
libinlink 2010-04-23
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 szh505776 的回复:]
DevComponents.DotNetBar2.dll 用这个
[/Quote]
非常好用
大地蚁人 2010-04-23
  • 打赏
  • 举报
回复
weifenluo.winformsui.docking.dll
rgshare 2010-04-23
  • 打赏
  • 举报
回复
codefuns.net源码
mayonglong 2010-04-23
  • 打赏
  • 举报
回复
学习了,都不错~~
捷哥1999 2010-04-23
  • 打赏
  • 举报
回复
http://download.csdn.net/source/2276444

看看我刚刚实现的这个吧,包含源代码,简单易用!
daredjever 2010-04-23
  • 打赏
  • 举报
回复
就是我怎么把这个写好的新的工具栏像原来的工具栏一样使用,添加到主界面,还能设置其他原有属性,进行界面设计布局等
daredjever 2010-04-23
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 szh505776 的回复:]

DevComponents.DotNetBar2.dll 用这个
[/Quote]

大哥这个好像不是免费的吧?到处都在说什么破解版,会过期,不敢放心用,也没仔细看是不是支持工具栏浮动
加载更多回复(5)

110,577

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧