473,395 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,395 software developers and data experts.

prevent form leave in form_leave event

How to prevent the user to leave a current form until he does something in current form or atleast close the form in windows form
Mar 16 '13 #1
1 1703
IronRazer
83 64KB
If it is not the main form but a second form that gets shown then you could show the form as a dialog form. Just Change (Form2) in this code to the name of your form.
Expand|Select|Wrap|Line Numbers
  1.         Form2.ShowDialog()
  2.  
Mar 16 '13 #2

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

Similar topics

2
by: Pamela Chatterjee | last post by:
In my Web Form I have more than one Textbox for user input. If I hit enter to any Textbox its submitting the form. How can I prevent Form submission if users hit enter to the textbox? I want to...
1
by: Jason | last post by:
I have a main form with a sub form. All the fields in the subform are mandatory. I had some code on the main form Before Update Event to check if all the fields in the sub form have data. If not, I...
4
by: deko | last post by:
I have a pop-up form in which user-defined parameters are entered. The parameters are entered into a subform datasheet which is bound to a table. I need to check the product of two parameters to...
3
by: feng | last post by:
We have a windows form project that has multiple child forms inherit from one base form. In our base form's form load event handler, we have some common logic in there. These common logic is...
5
by: gsb58 | last post by:
Hi! In my application I have code that will give the user a choice when he click's the close button on the ToolBar1. However, when he clicks the close button of the form, the form will shut...
1
by: kmercer46 | last post by:
i want to use a form's OnError event to close the form if an error occurs, but the event is not working. it just brings up the error window with the End and Debug buttons. i remember seeing an...
3
by: lesperancer | last post by:
I've got application A, with a hidden form, whose unload event is cancelled unless you use an 'exit' button (so I can do special processing) this works fine when using just application A and it...
3
by: sravan_reddy001 | last post by:
i want to prevent a form from closing.. to do this i want to handle the formClosing or FormClosed events. from here i want to prevent the form from closing. New instance of same form should...
0
by: Builder | last post by:
I made a simple app to test Leave focus event and AutoComplete functionality on the text box control. I added 2 text box controls on the blank form. Then I added Leave focus event handlers for...
6
by: Stanimir Stamenkov | last post by:
I have a form without a submit button like: <form name="form1" action="" onsubmit="alert('submit ' + this.name);"> <div> <label>Field 1: <input type="text" name="field1"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.