图像不透明度级别为 100%
我有一个用作按钮的图像,但在鼠标输入时我希望不透明度为 100%,而此时仅为 80%。我该怎么做呢?
这是我的鼠标输入事件
private void playButton_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
{
double x;
}
我正在使用混合,silverlight 4 谢谢
I have an image that I am using as a button but on the mouse enter I want the opacity to be 100%, which at this point is only 80%. How would I do that?
here is my mouse enter event
private void playButton_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
{
double x;
}
I am using blend, silverlight 4
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设您的事件被“击中”...
也就是说,您还应该响应鼠标移出事件并将不透明度设置回 0.8
您也可以使用视觉状态管理器来执行此操作。 这是 MSDN 上的一个很好的示例
assuming your event is being "hit"...
that said, you should also respond to the mouse out event and set the opacity back to .8
you could use the visual state manager to do this as well. here is a nice example on MSDN
您还可以在 XAML 中完成这一切。这需要 Blend SDK for Silverlight 4 (它实际上不需要 Blend,所以如果您没有或使用 Expression Blend,请不要被误导)。假设您从以下内容开始:
您可以将其转换为如下内容:
You could also do it all in XAML. This requires the Blend SDK for Silverlight 4 (which actually does not require Blend, so don't be misled if you don't have or use Expression Blend). Assuming you started with something like:
You could transform it into something like this: