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)来实现在特定组件上悬停时鼠标指针变为手型。
4932

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



