2

现在,如果我单击按钮 A,按钮 B 会显示 DropShadow 效果:

 Private Sub ButtonA_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles ButtonA.Click

 Dim objDropShadow As New DropShadowEffect
            objDropShadow.ShadowDepth = 0
            objDropShadow.BlurRadius = 30
            objDropShadow.Color = Colors.GreenYellow

            Me.ButtonB.Effect = objDropShadow

End Sub

如果我单击 Button C 如何从 Button B 中删除 DropShadow 效果?

4

2 回答 2

4

试试看

Me.ButtonB.Effect = Nothing        // VB.Net
this.ButtonB.Effect = null;        // C#
于 2013-07-18T05:04:07.087 回答
2
Private Sub ButtonC_Click(
  ByVal sender As System.Object, 
  ByVal e As System.Windows.RoutedEventArgs) Handles ButtonC.Click

 Dim objDropShadow As New DropShadowEffect
            objDropShadow.ShadowDepth = 0
            objDropShadow.BlurRadius = 0
            objDropShadow.Color = Colors.Transparent

            Me.ButtonB.Effect = objDropShadow

End Sub
于 2013-07-18T04:40:23.333 回答