1 回答

TA贡献1836条经验 获得超5个赞
不要将 的IsHitTestVisible属性设置TextBlock为false:
TextBlock popupText = new TextBlock();
popupText.Text = "Complete";
popupText.Background = Brushes.Transparent;
popupText.Foreground = Brushes.White;
popupText.Width = 130;
popupText.Height = 130;
popupText.FontSize = 30;
//popupText.IsHitTestVisible = false;
popupText.Cursor = Cursors.None;
Popup Popup = new Popup();
//Popup.AllowsTransparency = true;
Popup.PlacementRectangle = new Rect(1086, 16, 0, 0);
Popup.IsHitTestVisible = false;
Popup.Cursor = Cursors.None;
Popup.Child = popupText;
Popup.IsOpen = true;
另请注意,您的应用程序只能在光标实际位于应用程序元素之一上时更改光标。透明的“背景”Popup不属于您的应用程序,因此Cursors.None仅当您将鼠标指针移到TextBlock.
- 1 回答
- 0 关注
- 209 浏览
添加回答
举报