1 回答

TA貢獻(xiàn)1836條經(jīng)驗(yàn) 獲得超5個贊
不要將 的IsHitTestVisible屬性設(shè)置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;
另請注意,您的應(yīng)用程序只能在光標(biāo)實(shí)際位于應(yīng)用程序元素之一上時更改光標(biāo)。透明的“背景”Popup不屬于您的應(yīng)用程序,因此Cursors.None僅當(dāng)您將鼠標(biāo)指針移到TextBlock.
- 1 回答
- 0 關(guān)注
- 226 瀏覽
添加回答
舉報