RIACHINA 中国RIA开发者论坛RIA 客户端开发WPF 专区 [Blend] 做自定义按钮时遇到问题

[Blend] 做自定义按钮时遇到问题

[Blend] 做自定义按钮时遇到问题

在Blend里,通过Tools->Make Button把一个矩形变成了按钮,然后在模板里编辑,在事件里用IsMouseOver做了鼠标经过跟鼠标离开的过渡效果,测试运行正常,然后打算用IsPressed事件做按下去跟松手的过渡效果,可是在运行时确发现"鼠标经过","鼠标按下" 还有 "鼠标松开"的效果都正常,可是当"鼠标离开"时确没有反映,一直保持在"鼠标松开"时的样子。

请问这是什么问题呢? 我是用4个 Timeline分别做这4个过渡效果的.
 

回复:[Blend] 做自定义按钮时遇到问题

没怎么用blend做过开发 在WPF/E的SDK中是这么写的

<!-- Canvas MouseLeave event fires first, then TextBlock MouseLeave event -->
<Canvas
  xmlns="http://schemas.microsoft.com/client/2007"
  MouseLeave="javascript:rootCanvasMouseLeave">

  <TextBlock
  MouseLeave="javascript:textBlockMouseLeave"
  Text="Test order of MouseLeave events" />

</Canvas>



The following JavaScript example shows to implement a MouseLeave event handler function:
JavaScript     

function onMouseLeave(sender)
{
    // Remove the visibility of the caption TextBlock.
    sender.findName("captionTextBlock").opacity = 0;
}

你可以参考一下 我们一般都是用Canvas的
 
1  /  1  页   1 跳转

版权所有 riachina.com   Sitemap

Powered by Discuz!NT 2.1.202    Copyright © 2001-2008 Comsenz Inc.
Processed in 0 second(s) (Cached).
返顶部