1.在XAML中window下添加菜单,代码格式如下 <Window.Resources> <ContextMenu x:Key="StucmButton"> <MenuItem FontFamily="微软雅黑" Name="lookerStu" Header="查看学生信息" Click="lookerStu_Click"/