StackPanel 弹出菜单 ContextMenu

<StackPanel x:Name="stackpanel_zonghe"  Margin="0,10,0,0" Background="Transparent" Orientation="Horizontal">
         <StackPanel.ContextMenu>
               <ContextMenu StaysOpen="True">
                      <MenuItem Name="addModule" Header="添加模块" >
                              <MenuItem.Icon>
                                     <Image Source="Resources\add.png" Width="20" Height="20"/>
                              </MenuItem.Icon>
                        </MenuItem>
                  </ContextMenu>
          </StackPanel.ContextMenu>
</StackPanel>
 
注意必定须要将背景设置为透明  不然弹出的右键菜单看不见 Background="Transparent"
相关文章
相关标签/搜索