Winston
Well-known member
hey i have that problem too!!
i used divils method for vb.net
but it doesnt work
this is how it goes for my on closing event
does anyone know whats the problem? it seems fine
i used divils method for vb.net
but it doesnt work
this is how it goes for my on closing event
Code:
Private Sub frmMain_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
If System.Environment.HasShutdownStarted = True Then
Application.Exit()
Else
If Schedular.Settings.CloseButton = True Then
Checks if the Close button setting is true
If it is then
e.Cancel = True
Make close button to false, which is making it, its default role
If MessageBox.Show("Are you sure you want to exit Task Schedular? If Task Schedular is closed all tasks will be inactive", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) = DialogResult.Yes Then
Schedular.Settings.StartedIntoTray = False
Schedular.Main.XMLCollection_Save()
Me.Dispose()
Disposes the form
End
Ends the entire application
Else
End If
Else
If the close button setting is false then
e.Cancel = True
Make the close button to true, which is making its role custom
Select Case Schedular.Settings.ShowFrmMin
Selects the case of the setting ShowFrmMin
Case True
If the setting is true then
Me.Hide()
Hide the main form
Case False
If the setting is false then
Me.Hide()
Hide the form
Schedular.Forms.frmMain.ctxtTrayMenu.MenuItems.Item(0).Visible = False
Schedular.Forms.frmMain.ctxtTrayMenu.MenuItems.Item(1).Visible = False
Schedular.Forms.frmMain.ctxtTrayMenu.MenuItems.Item(2).Visible = False
Disable the menu items
Schedular.Forms.frmMain.TrayIcon.ShowBalloon(NotifyIcon2.NotifyIcon2.NotifyIcon2.EBalloonIcon.Info, "Task Schedular is still running!", "Palladium Info", 15000)
Display the balloon tip
Schedular.Forms.frmmin = New frmMin
Instantiate the form
Schedular.Forms.frmmin.TopMost = True
Make the form always on top
Schedular.Forms.frmmin.ShowDialog()
Display the the form as modal form
Schedular.Forms.frmmin = Nothing
End Select
End If
End If
End Sub
does anyone know whats the problem? it seems fine