2013-07-18 221 views
1

現在如果我按一下按鈕,按鈕B顯示了一個陰影效果的影響:WPF刪除陰影效果的影響

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 

如果我點擊按鈕C我將如何刪除按鈕B陰影效果的影響?

回答

1
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 
3

試試吧

Me.ButtonB.Effect = Nothing  // VB.Net 
this.ButtonB.Effect = null;  // C#