Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
tbaltC.Text = My.Settings.altC
tbaltD.Text = My.Settings.altD
tbaltA.Text = My.Settings.altA
tbaltB.Text = My.Settings.altB
tbaltE.Text = My.Settings.altE
tbaltF.Text = My.Settings.altF
tbaltG.Text = My.Settings.altG
tbaltH.Text = My.Settings.altH
tbaltI.Text = My.Settings.altI
tbaltJ.Text = My.Settings.altJ
RegisterHotKey(Me.Handle, 100, MOD_ALT, Keys.D)
RegisterHotKey(Me.Handle, 200, MOD_ALT, Keys.C)
RegisterHotKey(Me.Handle, 300, MOD_ALT, Keys.A)
RegisterHotKey(Me.Handle, 400, MOD_ALT, Keys.B)
RegisterHotKey(Me.Handle, 500, MOD_ALT, Keys.E)
RegisterHotKey(Me.Handle, 600, MOD_ALT, Keys.F)
RegisterHotKey(Me.Handle, 700, MOD_ALT, Keys.G)
RegisterHotKey(Me.Handle, 800, MOD_ALT, Keys.H)
RegisterHotKey(Me.Handle, 900, MOD_ALT, Keys.I)
RegisterHotKey(Me.Handle, 1000, MOD_ALT, Keys.J)
NotifyIcon1.Visible = True
NotifyIcon1.ShowBalloonTip(1000)
Me.WindowState = FormWindowState.Minimized
Me.Visible = False
End Sub
以下是我更新按钮的代码:
Private Sub btnUPDATE_Click(sender As Object, e As EventArgs) Handles btnUPDATE.Click
My.Settings.altC = tbaltC.Text
My.Settings.altD = tbaltD.Text
My.Settings.altA = tbaltA.Text
My.Settings.altB = tbaltB.Text
My.Settings.altE = tbaltE.Text
My.Settings.altF = tbaltF.Text
My.Settings.altG = tbaltG.Text
My.Settings.altH = tbaltH.Text
My.Settings.altI = tbaltI.Text
My.Settings.altJ = tbaltJ.Text
My.Settings.Save()
MsgBox("Your changes have been saved!", , "Settings")
RegisterHotKey(Me.Handle, 100, MOD_ALT, Keys.D)
RegisterHotKey(Me.Handle, 200, MOD_ALT, Keys.C)
RegisterHotKey(Me.Handle, 300, MOD_ALT, Keys.A)
RegisterHotKey(Me.Handle, 400, MOD_ALT, Keys.B)
RegisterHotKey(Me.Handle, 500, MOD_ALT, Keys.E)
RegisterHotKey(Me.Handle, 600, MOD_ALT, Keys.F)
RegisterHotKey(Me.Handle, 700, MOD_ALT, Keys.G)
RegisterHotKey(Me.Handle, 800, MOD_ALT, Keys.H)
RegisterHotKey(Me.Handle, 900, MOD_ALT, Keys.I)
RegisterHotKey(Me.Handle, 1000, MOD_ALT, Keys.J)
NotifyIcon1.Visible = True
NotifyIcon1.ShowBalloonTip(1000)
Me.WindowState = FormWindowState.Minimized
Me.Visible = False
End Sub
以下是Show Application上下文菜单的代码:
Private Sub ShowToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ShowToolStripMenuItem.Click
NotifyIcon1.Visible = False
Me.WindowState = FormWindowState.Normal
Me.Visible = True
End Sub
答案 0 :(得分:0)
这解决了我的问题:将以下内容放在ShowToolStripMenItem_Click
中Me.Visible = True
Me.Opacity = 100
Me.FormBorderStyle = FormBorderStyle.FixedSingle
Me.ShowInTaskbar = True
Me.WindowState = FormWindowState.Normal