目的:
如果在代码中使用需要 this.Cursor = new Cursor(“鼠标资源路径”); 此处的[鼠标资源路径]需要使用绝对路径,这样不便于程序移植。
解决方法1
2
3StreamResourceInfo sri=Application.GetResourceStream(new Uri("Cur\\xx.cur",UriKind.Relative));
Cursor customCursor=new Cursor(sri.Stream);
this.Cursor=customCursor;