5
Popup popUpControl = new Popup();

popUpControl.PlacementTarget = this; 
popUpControl.StaysOpen = true;
popUpControl.Child = new MyUserControl(); /// my user control 
popUpControl.Opacity = 0.5; // this code has no effect in the appearance of the popup
popUpControl.IsOpen = true;

どうやってするの?

4

2 に答える 2

12

ポップアップに透明性を持たせる必要があります。次のコード行を追加します。

popUpControl.AllowsTransparency=true;
于 2009-12-02T06:37:54.460 に答える
7

ポップアップコンテンツに不透明度を設定する必要があります。
だからあなたのボタンのために持っている

popUp.Child = new Button() 
{
    Width = 300,
    Height = 50,
    Background = Brushes.Gray,
    Opacity = 0.5 // set opacity here
};
于 2009-12-03T16:07:06.790 に答える