473,407 Members | 2,326 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,407 software developers and data experts.

Confirm Window Close

i have form i need when user Close the form a messagebox confirm him with

Yes or No if yes exist if no stay....how can i achieve this?
Nov 17 '05 #1
2 13139
Raed,

Have a look at this page, it tells in my opinion everything you want to know
about your problem.

http://msdn.microsoft.com/library/de...osingtopic.asp

I hope this helps,

Cor

"Raed Sawalha" <Ra*********@discussions.microsoft.com> schreef in bericht
news:B5**********************************@microsof t.com...
i have form i need when user Close the form a messagebox confirm him with

Yes or No if yes exist if no stay....how can i achieve this?

Nov 17 '05 #2
Hi,

Here you go:

protected override void OnClosing(CancelEventArgs e)
{
DialogResult result = MessageBox.Show("Really close?", "Confirm exit",
MessageBoxButtons.OKCancel);
e.Cancel = result == DialogResult.Cancel;
}

HTH,
Billy

"Raed Sawalha" <Ra*********@discussions.microsoft.com> wrote in message
news:B5**********************************@microsof t.com...
i have form i need when user Close the form a messagebox confirm him with

Yes or No if yes exist if no stay....how can i achieve this?

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Fabrizio | last post by:
I've this problem. I need, when the user close the web page, to show a message of confirm with Ok and cancel. With the event unload when I click cancel the web page closes however. What can I do...
2
by: Terry | last post by:
anyone know how to pop up a confirm window with (Y) & (N)?? I want to pop up a "Do you want to continue?" message box (javascript only, can't use vbscript) with (Y) & (N). when click (N), then...
2
by: Hans | last post by:
Hi! I have an asp application where I use a lot of javascript for validations etc and as it is today I use alert, confirm and prompt dialogs. Now we are adding support for unicode and I have...
3
by: Doug O'Leary | last post by:
Hey, all; Apparently, I'm missing the concept. I'm writing a web app in perl to manage nagios configuration files. One of the things I'd like to do is to confirm an update via a popup window...
2
by: phil2phil | last post by:
hi, is there anyway to make certain text in the confirm window, the one what comes up when i call confirm(text) in javascript? I'm displaying a message in the confirm window to the user and...
13
by: Chris | last post by:
I can create Javascript confirm message boxes during page creation, etc adding them to the button attributes (many good posts on this!). But how can I add this event after the button is pressed? I...
4
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I change the confirm box to say yes/no or default to cancel?...
3
by: tshad | last post by:
Is there a way to do a Javascript confirm box when an aspx page initially loads (not postback)? I can make the confirm box come up by doing the following:...
3
by: zizi2 | last post by:
I have dropdownlist where a user can select edit or delete. When a user selects delete, when they click submit a confirm box should come up to confirm if they do want to delete, my code is cuurnely...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.