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 關注
- 235 瀏覽
添加回答
舉報