toolbar.buttons如何感应到鼠标hover?
好像只有整个toolbar才有onMouseHover事件,里面的单个button如何才能对鼠标停留在自己上面做出响应?而且要想改变里面的button的外观也没有办法?(不是.net里面内设几种,类似于重写菜单的drawItem事件那样的重新改变外观) 问题点数:50、回复次数:6Top
1 楼Jamestan(情商蛋蛋)回复于 2005-06-03 20:15:20 得分 5
不要toolbar自带的buttons,用系统buttons。Top
2 楼gdipkf1986(纯粹理性)回复于 2005-06-03 23:39:22 得分 0
用普通的buttons?不会那么离奇吧Top
3 楼pxcwf(无名)回复于 2005-06-04 03:04:45 得分 30
protected override void OnMouseMove( MouseEventArgs e)
{
Graphics g = this.CreateGraphics();
for(int i=0;i<this.Buttons.Count;i++)
{
if(this.Buttons[i].Rectangle.Contains(PointToClient(MousePosition)))
{
}
else
{
}
}Top
4 楼pxcwf(无名)回复于 2005-06-04 03:09:32 得分 0
protected override void OnMouseMove( MouseEventArgs e)
{
Graphics g = this.CreateGraphics();
for(int i=0;i<this.Buttons.Count;i++)
{
if(this.Buttons[i].Rectangle.Contains(PointToClient(MousePosition)))
{ //画被选中的样式 }
else
{ //画其他的ToolBarButton的样式}
}
至于怎么画出XP风格的ToolBar是比较难,不是一句话能说清楚的
有兴趣加我的QQ,大家一起研究研究(QQ: 272143793)
Top
5 楼gatr()回复于 2005-06-04 10:31:05 得分 15
.net自带的ToolBar非常简陋,我现在是用一个panel+系统按钮完成。Top
6 楼gdipkf1986(纯粹理性)回复于 2005-06-04 18:23:48 得分 0
活活,有了楼上的提示就好办了,怎么画出XP样式我倒是知道,刚刚学做了一个xp风格的菜单
pxcwf(无名)的提示至少解决了第一步Top




