Highlighted
Absent Member.
Absent Member.
1806 views

X Button

Jump to solution

In visual cobol is there a way to trapped the X button on a winform being clicked.  I need to do some processing before closing the window. 

Thanks

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: X Button

Jump to solution

You need to generate a FormClosing event handler and add your code to the method that is generated.

You can do this by clicking on the form itself and then in the properties window, click the lightning icon to show a list of available events and scroll down until you see FormClosing and double click to the right of this event.

This will generate the method in your code-behind program and wire it up for you.

View solution in original post

0 Likes
5 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: X Button

Jump to solution

Trap the FormClosing event on the form itself and this will be fired whenever the user clicks on the X.

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: X Button

Jump to solution

Thanks!

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: X Button

Jump to solution

Sorry to ask this but how do you trap the form closing event?

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: X Button

Jump to solution

You need to generate a FormClosing event handler and add your code to the method that is generated.

You can do this by clicking on the form itself and then in the properties window, click the lightning icon to show a list of available events and scroll down until you see FormClosing and double click to the right of this event.

This will generate the method in your code-behind program and wire it up for you.

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: X Button

Jump to solution

Thanks Chris.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.