473,608 Members | 2,054 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 13150
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*********@di scussions.micro soft.com> schreef in bericht
news:B5******** *************** ***********@mic rosoft.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(Cance lEventArgs e)
{
DialogResult result = MessageBox.Show ("Really close?", "Confirm exit",
MessageBoxButto ns.OKCancel);
e.Cancel = result == DialogResult.Ca ncel;
}

HTH,
Billy

"Raed Sawalha" <Ra*********@di scussions.micro soft.com> wrote in message
news:B5******** *************** ***********@mic rosoft.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
16076
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 ? Sorry for the bad English. Hello.
2
3287
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 close the current window. If click (Y), then back to server side to continue. Is it possible?? Thanks a lot.
2
2827
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 problems with the font used to present messages in alert, prompts and confirm dialogs. If I for examle paste a chinese value in a prompt dialog it is shown om my machine as a vertical bar. When I write the value back to a textbox <input type="text"...
3
2833
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 prior to writing out changes. My first whack at that goal isn't working out too well. I have the following javascript in one of the pages:
2
1962
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 wanted to make certain text bold.
13
5653
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 have created an Is_Dirty routine checking for field changes on my page then if the user clicks on the "exit" button I check for Is_Dirty = true and want to ask then "do you want to exit without saving?". It's a code behind where if the value of...
4
8642
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I change the confirm box to say yes/no or default to cancel? ----------------------------------------------------------------------- The buttons on a confirm box cannot be changed, nor can you specify a default button. However, you should be able to change the question so that "OK" is suitable as the default. e.g. change "We will now buy ourselves...
3
1900
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: *************************************************** <script type="text/javascript"> function CheckForProfile() { confirm("Do you want to Enter a Profile?"); } </script>
3
4796
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 not working, can someone tell me what is wrong? <script type="text/javascript" language="javascript"> function ConfirmBox() { return confirm("Do you want to continue?"); } </script>
0
8087
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8493
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8179
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8365
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6847
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5499
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3993
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4053
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1363
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.