WPF 如何在代码中使用自定义的鼠标资源
摘要:如果想要在XAML中使用自定义鼠标很容易,直接在标签中设定 Cursor="/asserts/hand.ani" 即可,但是如果在代码中使用需要 this.Cursor = new Cursor("鼠标资源路径");此处的[鼠标资源路径]需要使用绝对路径,这就不叫麻烦了。另一种方法就是使用(本人未验证):StreamResourceInfo sri = Application.GetResourceStream(new Uri("/assets/cursor/hand.ani", UriKind.Relative));Cursor c
阅读全文
posted @ 2012-04-09 18:16