473,322 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

C# Win App : searching for a "before_close" event

pod
298 100+
Hello

I am searching for a "before_close" event; if someone closes the window form, I need to run some queries...

thanks

Perry
Oct 12 '07 #1
6 1070
Plater
7,872 Expert 4TB
Use the FormClosing event.
You can optional choose to cancel a closure with is.
Oct 12 '07 #2
pod
298 100+
Use the FormClosing event.
You can optional choose to cancel a closure with is.
what took you so long ?

thanks Plater, that's what I was looking for... I was trying every other permutation of words but this one I missed.
Oct 12 '07 #3
Plater
7,872 Expert 4TB
If you select a control (the form counts as a control) and go the properties page, there is a lightening bolt button, that switches the view to see all of the events associated with the Control.
Oct 12 '07 #4
pod
298 100+
If you select a control (the form counts as a control) and go the properties page, there is a lightening bolt button, that switches the view to see all of the events associated with the Control.
Thanks again, this is very helpful in understanding the tool I work with.

I am just starting to wrap my mind into Object Oriented Programming, I know I have a lot to learn still. If you have a couple of good links on OOP, I would appreciate it. The relation between class files and their types is very nebulous to me

Expand|Select|Wrap|Line Numbers
  1. Namespace NameName{
  2.  
  3.    class Name:BaseType{
  4.  
  5.    }
  6.  
  7. }
  8.  
Oct 12 '07 #5
pod
298 100+
Use the FormClosing event.
You can optional choose to cancel a closure with is.
how would I go about cancelling?
Oct 12 '07 #6
Plater
7,872 Expert 4TB
Expand|Select|Wrap|Line Numbers
  1. private void MainPage_FormClosing(object sender, FormClosingEventArgs e)
  2. {
  3.     if (e.CloseReason == CloseReason.UserClosing)
  4.     {//when user trys to close the application
  5.     }
  6.     //to cancel, set e.Cancel =true;
  7.  
  8. }
  9.  
Oct 12 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

21
by: Alo Sarv | last post by:
Hi From what I have understood from various posts in this newsgroup, writing event loops pretty much comes down to this: while (true) { handleEvents(); sleep(1); // or _sleep() or...
2
by: VMI | last post by:
I'm trying to some dynamic searching to my windows Form so I added code in my TextBox.TextChanged so that, after every text change, a search is done to a datatable. So if I want to type the string...
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
3
by: jeff29_b | last post by:
I am having a strange problem on a web form. I have an image button with an OnClick event handler. When I click the image the event isn't being called in the code behind when browsing in firefox....
5
by: Dan Brill | last post by:
Hi, I'm sure this issue has been covered before but after searching around I can't find anything which deals with quite the same set of circumstances or suggests an optimal solution. The...
5
by: Mike Labosh | last post by:
In VB 6, the Form_QueryUnload event had an UnloadMode parameter that let me find out *why* a form is unloading, and then conditionally cancel the event. In VB.NET, the Closing event passes a...
33
by: Geoff Jones | last post by:
Hiya I have a DataTable containing thousands of records. Each record has a primary key field called "ID" and another field called "PRODUCT" I want to retrieve the rows that satisy the following...
0
by: Piotrek | last post by:
Hi. I am developing a web app. On the main page I have two user controls: searchControl and detailsControl. In the searchControl I have a GridView. On this GridView DataBound handler I am...
3
by: Aaron | last post by:
I'm trying to parse a table on a webpage to pull down some data I need. The page is based off of information entered into a form. when you submit the data from the form it displays a...
8
by: SSG001 | last post by:
i have used dropdown.js file which does the searching in select box i have main.php where in the two .js files are called one is dropdown.js which has a function to search and other .js file creates...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.