Morning everyone! I built a hotkeys program and it works wonderful. What i am doing is using my.settings to store weblinks that users want to use the hotkeys with, once they hit Update, or minimize, i have my app save to my.settings and minimize to the task tray. Once they click "Show Application" from the task tray context menu, it loads fine, but if they go to click "Show Application" again, it doesnt load the window, it loads it to the task bar, but i cant click on it to load to the screen for users to make updates. Below is my code for the ONLOAD:
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
Here is my code for the Update button:
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
Here is my code for the Show Application context menu:
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