C#WPF 右键菜单 显示 事件触发 测试通过
//这里为按键响应事件
private void PushOutMessageBox(object sender, RoutedEventArgs e)
{
MessageBox.Show("弹出一个窗口~然后修改右键菜单显示");
//获取或设置右键菜单信息
(e.Source as MenuItem).Header = "hello world";
//设置背景颜色
SolidColorBrush m_scb = new SolidColorBrush();
m_scb.Color = Color.FromRgb(132,132,132);
(e.Source as MenuItem).Background = m_scb;
}
1