Powershell WPF导航栏创建ContextMenuStrip?

时间:2016-12-03 06:00:30

标签: wpf powershell

当我将鼠标悬停在导航栏中的图标上时,我需要创建一条消息(如USB图标的'安全删除硬件..')点击此处退出'。我用它来创建图标:

.
.
$notifyIcon.Icon = $icon 
$notifyIcon.BalloonTipIcon  = "Info" 
$notifyIcon.BalloonTipTitle = "Powershell Search"
$notifyIcon.BalloonTipText  = "Loading Search GUI. Please wait ..."
$notifyIcon.Visible = $True 
$notifyIcon.ShowBalloonTip(50)
#Create mouse hover box here.
$notifyIcon.add_Click({                         
    $notifyIcon.Visible = $false
    $form.Close()
    Stop-Process $pid
})

我知道我可以使用Add-MouseEnter,但我不想在这里使用ToolTip消息。

1 个答案:

答案 0 :(得分:0)

这应该可以帮到你:

$objNotifyIcon.Text = "when hover appear"