首页 > 其他分享 >handycontrol NotifyIcon ContextMenu

handycontrol NotifyIcon ContextMenu

时间:2024-11-15 17:40:33浏览次数:1  
标签:handycontrol NotifyIcon ContextMenu

  <hc:NotifyIcon Text="xxxx程序"  Visibility="Collapsed"  Name="notifyIcon" 
         Icon="/Assets/Ico/title.ico" Click="NotifyIcon_Click" MouseRightButtonDown="notifyIcon_MouseRightButtonDown" >
      <hc:NotifyIcon.ContextMenu>
          <ContextMenu>
              <MenuItem Command="hc:ControlCommands.PushMainWindow2Top" Header="显示" />
              <MenuItem Command="hc:ControlCommands.ShutdownApp" Header="退出" />
          </ContextMenu>
      </hc:NotifyIcon.ContextMenu>
      <hc:Interaction.Triggers>
          <hc:EventTrigger EventName="Click">
              <hc:EventToCommand Command="hc:ControlCommands.PushMainWindow2Top"/>
          </hc:EventTrigger>
          <hc:EventTrigger EventName="MouseDoubleClick">
              <hc:EventToCommand Command="hc:ControlCommands.PushMainWindow2Top"/>
          </hc:EventTrigger>
      </hc:Interaction.Triggers>
  </hc:NotifyIcon>

标签:handycontrol,NotifyIcon,ContextMenu
From: https://www.cnblogs.com/ives/p/18548400

相关文章