"There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." - C.A.R. Hoare
So, Im writing a Forms application, an I am using the Validating event on some TextBoxes (setting e.Cancel = true if bad input). It works just fine until I click the red x in order to exit the application. If a textbox with faulty text has the focus then, the Validating event runs and makes the application not exit. What can I do about it?
Thanks, that article is exactly what I experience. Though the trick with the FormClosing event didnt really do it for me. The application does exit, but not until my MessageBox is sprung from the Validating event.
What did work the way I intended (the application exiting without any validating), was the WndProc override.
privateconstint WM_CLOSE = 0x0010;
protectedoverridevoid WndProc(ref Message m)
if (m.Msg == WM_CLOSE) // Attempting to close Form
AutoValidate = AutoValidate.Disable; //this stops (all) validations
base.WndProc(ref m); //call the base method to handle other messages
two days age i start visual basic.net and i know basic syntax of java and c++ very well now i want to see whole classes and methods of .NET Framework class libraries same like the documentation of java language so help me how to download the documentation
Visual Studio 2010 VB using the VS Setup and Deploy to create an MSI install file.
2 Similar programs uninstalling each other.
We had a program running for a few years. We needed a similar program so we decided to use it a base. So The Program 1 folder was copied to create the Program 2 folder. Renames were done on the folder names and main modules. SLN file changed. The GUID in the Assembly info was changed.
We can install either but when we install program 2 from the IDE it first uninstalls program 1. Same when we install Program 1 it uninstalls program 2.
When we install them they both appear with the correct name in Control Panel programs but one or the other.
I understand something got crossed but what?
How can we fix it?
Most likely the Product Code got duplicated from the first to the second setup. Each installer must have a unique Product Code which is a GUID.
I can't help you find it in Visual Studio, though, because I never use those setup projects. I use InstallShield.
Try looking for the Product Code and change it in the second setup.
NOTE: The Upgrade Code must also be unique for a separate product installer. If product 2 is only an upgrade of product 1, then the Upgrade Codes should be the same, otherwise they should be different.
The difficult we do right away...
...the impossible takes slightly longer.