Trainee
Date of registration: Jul 11th 2014
About me: A beginner programmer.
Location: ...Jabaco Academy
Occupation: i have some but still not enough...
Hobbies: Jabaco
Jabaco Source |
|
1 2 3 4 5 6 7 8 |
Public Sub Form_Unload(cancel As Integer) If MsgBox ("You will be logged out!", vbInformation + vbOKCancel ) = vbOK Then Load Form1 Form1.Show Else cancel = 1 End If End Sub |
Jabaco Source |
|
1 2 |
Load Form1
Form1.Show
|
Trainee
Date of registration: Jul 11th 2014
About me: A beginner programmer.
Location: ...Jabaco Academy
Occupation: i have some but still not enough...
Hobbies: Jabaco
Trainee
Date of registration: Jul 11th 2014
About me: A beginner programmer.
Location: ...Jabaco Academy
Occupation: i have some but still not enough...
Hobbies: Jabaco
Jabaco Source |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
Public Sub windowClosing(arg2 As WindowEvent) Me.Parent.setDefaultCloseOperation(0) Dim p As Integer p = Form_Unload() If p <> 1 Then System.exit(0) End If End Sub Public Function Form_Unload() As Integer If MsgBox ("You will be logged out!", vbInformation + vbOKCancel ) = vbOK Then Form_Unload = 0 Else Form_Unload = 1 End If End Function |
Trainee
Date of registration: Jul 11th 2014
About me: A beginner programmer.
Location: ...Jabaco Academy
Occupation: i have some but still not enough...
Hobbies: Jabaco
Jabaco Source |
|
1 2 3 4 5 6 7 |
Public Function Form_Unload() As Integer If MsgBox ("You will be logged out!", vbInformation + vbOKCancel ) <> vbOK Then Form_Unload = 1 Else Form_Unload = 0 End If End Function |
Trainee
Date of registration: Jul 11th 2014
About me: A beginner programmer.
Location: ...Jabaco Academy
Occupation: i have some but still not enough...
Hobbies: Jabaco
Trainee
Date of registration: Jul 11th 2014
About me: A beginner programmer.
Location: ...Jabaco Academy
Occupation: i have some but still not enough...
Hobbies: Jabaco
This post has been edited 1 times, last edit by "spysonic" (Aug 29th 2014, 11:03am)
Jabaco Source |
|
1 2 3 |
Public Sub Form_Unload() As Integer End Sub |
Jabaco Source |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
Dim myCancelUnload As Boolean Public Sub windowClosing(arg2 As WindowEvent) On Error Resume Next Me.Parent.setDefaultCloseOperation(0) Call Form_Unload() If myCancelUnload = False Then System.exit(0) End If End Sub Public Property Let CancelUnload(v As Boolean) myCancelUnload = v End Property Public Sub Form_Unload(Optional Cancel As Integer) 'cancel is not used, is only for compatibility 'myCancelUnload = Cancel 'unfortunatly does not work! End Sub |
Jabaco Source |
|
1 2 3 |
Public Sub Form_Unload(cancel As Integer) Me.CancelUnload = True End Sub |