473,778 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

stop closing event from validating

Greetings

I am sure this is a simple question. But I have "googled" it to death
and have only found one answer that involved a bunch of window's API
calls that I did not understand.

I am a student taking VB.NET and we are studying the Validation event
and how to use it on text boxs. I have set the forms.causevali dation
property to false. But if the user has bad data in the text box and
just wants to quit the program by clicking on the control box 'x' on the
upper right corner of the form they are stuck until they correct the
data in the text box. It appears some how the closing event is firing
some sort of validating event. I found a post from Herfried to set the
offending text box's causes validation to false in the form closing
event and that will work the second time the user tries to close the
form but not the first.

I do have the exit button working correctly, but that seems cheesy to me
to not be able to close the form.

Any ideas?

thanks

Bob

Nov 20 '05 #1
2 2041
Cor
Hi Bob,
I know it is (if I understand you well) the e.cancel in the validating
event, that has to be set to true or false to in this kind of situations.

Only I once have took time to searched what it was, put it in this newsgroup
and suddenly it was disapeared.

I now have the feeling not to do it again, I only remember me that it was
what you not would expect so probably false.

So do me a favour, find it out what it is "true" or "false" and send that
back to this newsgroup in this thread.

If you don't succeed, message it, than I will look again
I hopes we help each other?

Cor
Nov 20 '05 #2
Hi Cor

Cor wrote:
Hi Bob,
I know it is (if I understand you well) the e.cancel in the validating
event, that has to be set to true or false to in this kind of situations.
Yes that is exactly what I was talking about. How to stop the e.cancel
from being set to true in the text box validating event when I am
closing the form by way of the control box in upper right hand corner.

Only I once have took time to searched what it was, put it in this newsgroup
and suddenly it was disapeared.
Sounds like the story of my life <grin>

I now have the feeling not to do it again, I only remember me that it was
what you not would expect so probably false.

So do me a favour, find it out what it is "true" or "false" and send that
back to this newsgroup in this thread.

If you don't succeed, message it, than I will look again
I hopes we help each other?

Cor

thanks Bob

Nov 20 '05 #3

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

Similar topics

0
1065
by: Bevo | last post by:
I validate my textbox input data on its Validating-event. But what if the textbox has focus when I click on the windows close button? Then I dont want to validate - at least not until I've confirmed the 'Do you want to save your changes?' question Since the textbox's Validating is fired before the form's Closing event, how can I cancel the Validating? Whats the best way to deal with this standard issue?
3
1932
by: Saradhi | last post by:
Hi, I wanted to stop the VS.NET Window from closing inside my C# AddIn. I Know that OnBeginShutdown() funciton will be called whenever the user tries to close the VS.NET window. I want to check some conditions and if those conditions doesnt meet, then I want to stop the VS.NET window from closing. Anybody have any diea?
6
10127
by: John S | last post by:
When the user clicks the "X" in the upper right-hand corner of a form, how can I stop the form from closing?
3
2778
by: Charles Law | last post by:
Under what circumstances would e.Cancel be set to True on entry to the Closing event of an MDI child form? I have found that this is why my application won't close properly. I can explicitly set the value to False, but I would have expected it to be False on entry. TIA Charles
19
3227
by: zacks | last post by:
I have a .NET 2.0 MDI application where the child form has a Tab Control. Each of the Tab in the Tab Control has a Validating event to handle what it should do when the user changes tabs. But these Validating Events are also fired when either the child form or the main (parent) form Close icon is clicked. And I need for these events to know if they are being invoked because the app (or child window) is being closed. I have set a boolean...
3
2215
by: mtczx232 | last post by:
I have TabControls that Hold Forms on his TabPges (this make me easy to give ability to Designing each form in his IDE window). When form x is in middle of Edit Data Mode, I going to prevent: Closing App or switch to other tabs until save done explicit by user. So I try use events like: deactivate,leave,lostfocus,formclosing,validating to prevent user leave before save. but no one work: the not fire at all when app closing or switch...
0
9629
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
9465
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10068
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
9923
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
6723
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
5370
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
5497
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4031
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3627
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.