我的应用程序中有一些自定义光标。 我使用 informations found on the second answer here来创建我的自定义光标。这很好。 我的问题是,当我将鼠标移到弹出窗口上时,鼠标显示为默认的光标。奇怪的是,当我将鼠标移出弹出窗口时,我的自定义光标回来了。 行,所以我实例化我的光标,像这样:在WPF弹出窗口中保留自定义光标
UserControl.xaml:
<TextBlock
x:Name="SupprimerV"
x:Key="SupprimerV"
Cursor="../Utils/Supprimer.cur"/>
在UserControl.xaml.cs:
this.Cursor = ((TextBlock)this.FindResource("SupprimerV")).Cursor;
然后,我打电话从派生我自己的控制SimplePopup Popup like so:
_pop = new SimplePopup(this); //Irrelevant information omitted
SimplePopup.cs:
public simplePopup(FrameworkElement relativeTo)
{
this._relativeTo = relativeTo;
this.Cursor = relativeTo.Cursor; //Trying to set the cursor of the popup but dosent work
...
}
我试图设置弹出光标,但它dosent似乎工作。 游标在我的UserControl上正常工作,但当鼠标悬停在Popup上时会失败。
我错过了什么? 是否阻止我的光标在Popup上正常工作?
日Thnx的帮助, 对不起拼写错误^^