473,788 Members | 2,694 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[Form].OnClosing - e.Cancel = True???

Has any come across a situation where, in a Form-derived .. er .. Form,
the Event Arguments passed to OnClosing /already/ have their Cancel
argument set to True?

Protected Overrides Sub OnClosing( _
ByVal e As System.Componen tModel.CancelEv entArgs _
)
Debug.WriteLine ("e.Cancel=( " & e.Cancel.ToStri ng() & ")")
' It's True already !!

MyBase.OnClosin g(e)
.. . .

This is making closing my form just a /little/ difficult!

Any suggestions where to start looking?

TIA,
Phill W.

ps. I'm using VB 2003 (v7.1.3088) on Windows XP, SP2.
Feb 8 '06 #1
1 4091
It could have to do with validating events on controles who have
causesvalidatio n set to true. I had the same problem once, and with me that
was the cause. Do a search on this group via google and search for: e.cancel
causesvalidatio n

Hope this helps

Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"Phill W." <p-***********@o-p-e-n.a-c.u-k> schreef in bericht
news:ds******** **@yarrow.open. ac.uk...
Has any come across a situation where, in a Form-derived .. er .. Form,
the Event Arguments passed to OnClosing /already/ have their Cancel
argument set to True?

Protected Overrides Sub OnClosing( _
ByVal e As System.Componen tModel.CancelEv entArgs _
)
Debug.WriteLine ("e.Cancel=( " & e.Cancel.ToStri ng() & ")")
' It's True already !!

MyBase.OnClosin g(e)
. . .

This is making closing my form just a /little/ difficult!

Any suggestions where to start looking?

TIA,
Phill W.

ps. I'm using VB 2003 (v7.1.3088) on Windows XP, SP2.

Feb 9 '06 #2

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

Similar topics

1
2105
by: Jules Winfield | last post by:
My WinForms application can have any number of top level forms open at a given time. If the user selects File|Exit, all of the forms are closed. The loop to close the forms looks something like this: foreach(MyForm form in AllMyForms){ form.Close(); } Application.Exit(); The OnClosing method is overridden in MyForm. If the user has made changes to his form, this method asks him if he'd like to: a) save his changes b) forget changes...
5
73216
by: RAJ | last post by:
hi plz tell me how to know "how window is going to close"... i have to right code for X button of forms... plz telll me thanks bye
4
1625
by: pei_world | last post by:
1.when the user click the close button on the top right of the form, I would like to pop up a message box ask for answer, if user click no, then ignore the action, otherwise exit the app. 2.trying to do something like, click on the close button, the app still run, and only display the noticfyicon in tary bar. thanks
7
7901
by: Nikki | last post by:
Hi, Can anybody help me, i want to prevent windows to close my winform of ..NET application, when user presses Alt+F4
2
1901
by: Steve McLellan | last post by:
Hi all, I'm trying to override Form events (for example OnClosing or OnClose) with the intention of preventing the base class function from happening. My functions are getting called but so are the base class ones, which isn't what I want (for example, I was hoping an empty OnClose event would make closing the form impossible). Two questions: 1) Is this the right way to do this, or should I be detaching event handlers? and 2) Any reason...
5
2133
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 down even if he chooses the cancel button of the messagebox that pop's up. Now...if he, on the other hand, chooses ALT+F4, then I catch this in
2
1827
by: polocar | last post by:
Hi, I'm writing a C# program that interfaces with a SQL Server 2005 database (I use Visual Studio 2005 Professional Edition as compiler). I have defined the classical ADO.NET SqlDataAdapter, DataSet and DataTable objects so that, once the database has been loaded with the SqlDataAdapter Fill method, you work with the data off-line. I would like to put a control in the Form OnClosing event handler method: if there are some changes...
2
3298
by: polocar | last post by:
Hi, suppose that you have a C# form with two buttons, that are the classical "btnOk" and "btnCancel" (besides them, of course in the form there can be many other controls). When the user clicks on btnOk, the program makes some confirm operations and closes the form. When the user clicks on btnCancel, the program makes some cancel operations and closes the form. My problem is that, when the user clicks on the "X" button of the form...
2
1688
by: richard.martino | last post by:
Windows Experts: 1. I have a desktop application with a UserControl that contains controls: TextBoxes, RadioButtons, CheckBoxes and NumericUpDowns. 2. I want to warn the user that, if there is unsaved data within my UserControl when he tries to 'X' out of the entire application, to display a MessageBox. 3. Unfortunately, System.Windows.Forms.UserControl does not have a
0
9656
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
9498
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,...
0
10177
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
10113
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
9969
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
8995
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...
1
7519
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5402
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
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.