1,105,380 Community Members

FORM TERMINATED UNEXPECTEDLY

Member Avatar
GeekPlease
Junior Poster
109 posts since May 2013
Reputation Points: 16 [?]
Q&As Helped to Solve: 8 [?]
Skill Endorsements: 0 [?]
 
0
 

Good day folks,

I just wanna ask what event should I used to detect when a
form is closed unexpectedly.

I want to update the Log In status of a user in my database
from 'Logged In' to 'Log Out' whenever a form closes the
form unexpectedly or not.

Example, I close the form using task manager. How would I trigger
form closing event?

Member Avatar
Rahul47
Posting Whiz
340 posts since Jan 2013
Reputation Points: 13 [?]
Q&As Helped to Solve: 20 [?]
Skill Endorsements: 2 [?]
 
0
 

You can use FormClosing event in this scenerio, you can find it in event list.

4ca5556f55a6f028a4c63e7f46537b2e

Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
        ' Do what you want to do.
End Sub
Attachments
Member Avatar
DM Galaxy
Junior Poster in Training
65 posts since Aug 2013
Reputation Points: -6 [?]
Q&As Helped to Solve: 2 [?]
Skill Endorsements: 5 [?]
 
0
 

agree with Rahul47...

@Rahul47,
Can you tell mw how you add the image in the comment box,?
Please

Member Avatar
Rahul47
Posting Whiz
340 posts since Jan 2013
Reputation Points: 13 [?]
Q&As Helped to Solve: 20 [?]
Skill Endorsements: 2 [?]
 
1
 

4254ca2773a68a5e8a061b3e2397457f

11e2245793512a1fbde4dedfeed2bbc5

7d8e14fdb2ae6671b84cf0d0ff543e17

5) You will get something like this --> ![7d8e14fdb2ae6671b84cf0d0ff543e17](/attachments/fetch/L2ltYWdlcy9hdHRhY2htZW50cy80LzdkOGUxNGZkYjJhZTY2NzFiODRjZjBkMGZmNTQzZTE3LmpwZw%3D%3D/500 "7d8e14fdb2ae6671b84cf0d0ff543e17")

Dont worry and submit your reply.

I hope you enjoyed.

Attachments
You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: