资 源 简 介
Visual C# 实现凹凸按钮(立体按钮效果),鼠标放在按钮上,按下鼠标左键,即可看到凹凸效果:
private void Window_Loaded(object sender, RoutedEventArgs e)
{//(上凸效果)
BevelBitmapEffect MyBevelEffect = new BevelBitmapEffect();
MyBevelEffect.BevelWidth = 20;
MyBevelEffect.EdgeProfile = EdgeProfile.CurvedIn;
MyBevelEffect.LightAngle = 320;
MyBevelEffect.Relief = 0.4;
MyBevelEffect.Smoothness = 0.4;
this.button1.BitmapEffect = MyBevelEffect;
bShift = true;
}
private void button1_Click(object sender, RoutedEventArgs e)
{//凹凸显示按钮(下凸效果)
if (bShift)
{
BevelBitmapEffect MyBevelEffect = new BevelBitmapEffect();
MyBevelEffect.BevelWidth = 20;
this.button1.BitmapEffect = MyBevelEffect;
bShift = false;
}
else
{
BevelBitmapEffect MyBevelEffect = new BevelBitmapEffect();
MyBevelEffect.BevelWidth = 20;
MyBevelEffect.EdgeProfile = EdgeProfile.CurvedIn;
MyBevelEffect.Ligh