Problem Summary
How do I change the mouse cursor to a hand when the mouse is over a particular Label or other component?
Solution Summary
Set three properties on the component: useHandCursor=true, buttonMode=true, and mouseChildren=false.
Explanation
You have a Label, and you want the mouse cursor shape to change to a hand whenever the mouse moves over that control. You notice in the code hints that Label has a property called "useHandCursor", so you think your problem is solved:
<mx:Label useHandCursor="true" /
But oddly, that doesn't do the trick.
To get this to work, there are three properties of the control you have to set:
- Set useHandCursor to true
- Set buttonMode to true
- Set mouseChildren to false
Like this:
<mx:Label useHandCursor="true" buttonMode="true" mouseChildren="false" />
Once you do that, the hand cursor will appear every time the mouse moves over the label. This works for most components, not just Label.
本文详细介绍了如何通过设置组件的useHandCursor、buttonMode和mouseChildren属性来改变鼠标指针为手型,在指定控件上悬停时生效。适用于多数组件,包括Label。
4939

被折叠的 条评论
为什么被折叠?



