Hi Herfried,
Sorry, Thank you for your immediate reponse.
i have solved this problem,
Please see the save event below
(MDI form save button in toolbar)
when i click the save button, event flow like
step 1:
Private Sub TEST_Closing(ByVal sender As Object, ByVal
e As System.ComponentModel.CancelEventArgs) Handles
MyBase.Closing
If Me.gdstTEST.HasChanges() Then
Select Case (MessageBox.Show(" Do you want to
save the changes that you made ", "Test",
MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning,
MessageBoxDefaultButton.Button1))
Case DialogResult.Yes
Me.DoSave()
Case DialogResult.No
Me.gdstTEST.RejectChanges()
Me.Close()
Case DialogResult.Cancel
e.Cancel = True
End Select
End If
End Sub
step 2:
Public Sub UnhookAllActions() Implements
IToolbarActionManager.UnhookAllActions
saveAction = Nothing
deleteAction = Nothing
clearAction = Nothing
End Sub
step 3:
Private saveAction As Core.ToolbarAction
Private deleteAction As Core.ToolbarAction
Private clearAction As Core.ToolbarAction
Private Sub ToolBar_ButtonClick(ByVal sender As
System.Object, ByVal e As
System.Windows.Forms.ToolBarButtonClickEventArgs) Handles
ToolBar.ButtonClick
If e.Button.Text = "Save" And Not saveAction Is
Nothing Then
saveAction()
ElseIf e.Button.Text = "Clear" And Not clearAction
Is Nothing Then
clearAction()
ElseIf e.Button.Text = "Delete" And Not
deleteAction Is Nothing Then
deleteAction()
End If
End Sub
when i click the save button, saveAction will be maked
as nothing,
So the event has not been worked. i resolved this problem.
Thank you
-----Original Message-----
* "Amalorpavanathan Y \(AMAL\)" <am*********@lycos.com>
scripsit:
Private Sub TEST_Closing(ByVal sender As Object,
ByVal e As System.ComponentModel.CancelEventArgs) Handles
MyBase.Closing
If Me.gdstTEST.HasChanges() Then
Select Case (MessageBox.Show(" Do you want
to save the changes that you made ", "Test",
MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning,
MessageBoxDefaultButton.Button1))
Case DialogResult.Yes
Me.DoSave()
Case DialogResult.No
Me.gdstTEST.RejectChanges()
Me.Close()
Case DialogResult.Cancel
e.Cancel = True
End Select
End If
End Sub
And where is the "Save" button?
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
.