I have used this code in many of my applications but now it seems to be erroring and I'm not sure what is causing the error. Basically when I click on the NotifyIcon I want o show the form and when its minimized i want to not show up in the taskbar.
VB Code:
Private Sub Main_SizeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.SizeChanged If Me.WindowState = FormWindowState.Minimized Then Me.ShowInTaskbar = False NotifyIcon.Visible = True Else [COLOR=Red] Me.ShowInTaskbar = True 'Error[/COLOR] NotifyIcon.Visible = False End If End Sub
Here is the execption that is getting thrown.
System.ComponentModel.Win32Exception was unhandled ErrorCode=-2147467259 Message="Error creating window handle." Source="System.Windows.Forms"
Any ideas for a solution?
Thanks In Advance




Reply With Quote