hi all,
below is the code i have..
what happens is when the form is loaded, data is also filled. so to test if it's working, i immediately close the form after it is loaded without doing any changes but then i get the messagebox even still.
is this a normal behavior or am i doing something wrong?
thanks
below is the code i have..
VB.NET:
Private Sub fknluser_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
Me.Validate()
Me.KnlrolesBindingSource.EndEdit()
Me.Knl_usersBindingSource.EndEdit()
Me.Knl_user_rolesBindingSource.EndEdit()
If Me.Dsknluser.HasChanges = True Then
Dim result As DialogResult = ShowYesNoCancel("Do you want to save changes?")
If result = Windows.Forms.DialogResult.OK Then
Record_Update()
ElseIf result = Windows.Forms.DialogResult.Cancel Then
e.Cancel = True
End If
End If
End Sub
Private Sub fknluser_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Initialize()
Knl_rolesDataAdapter.Fill(Me.Dsknluser.knl_roles)
Knl_usersDataAdapter.Fill(Me.Dsknluser.knl_users)
Knl_user_rolesDataAdapter.Fill(Me.Dsknluser.knl_user_roles)
End Sub
what happens is when the form is loaded, data is also filled. so to test if it's working, i immediately close the form after it is loaded without doing any changes but then i get the messagebox even still.
is this a normal behavior or am i doing something wrong?
thanks