473,382 Members | 1,635 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,382 software developers and data experts.

problem with causesvalidation property (Visual studio 2005)

Dear all

I require certain clarification on following line.

This is regarding causesvalidation property of visualstudio 2005 controls.

Iam using windows forms not web forms.

Inorder to validate the data entered in a text box I have made
causesvalidation property of the text box to true. Then the following code is
typed within the validating event of the text box. This is working as
expected.

void EmpNameTextBox_Validating(object sender, CancelEventArgs e) {
if( EmpNameTextBox.Text.Length == 0 )
{
MessageBox.Show("Please enter a name", "Error");
e.Cancel = true;
}
}
The problem arises when I try to bypass the validation of the above
mentioned textbox when clicking a button (Exit button) which is to exit from
the form. I can explain it as followos.

The above mentioned textbox validation should be bypassed when I press the
Exit buton.

For this I have made the causesvalidation property of the exit button to
false (design time). Then the following code is typed in the click event of
the exit button.

pivate void exit_click(object as sender, EventArgs as e)
{
this.dispose()
}

Various study meterials on VS 2005 explains that if the causesvalidation
property of a control is made false it shoud by pass all the other
validations mentioned in other controls. But practically it is not happening.
The exit button still fires the validationg event of empname textbox.

Can anybody suggest some ways to bypass the validating event of empname text
box while pressing exit button.

Rajeev
Mar 23 '07 #1
0 3159

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

Similar topics

3
by: Nathan Sokalski | last post by:
I have a User Control that I created (.ascx & .ascx.vb file pair) that I am trying to put in a separate assembly. I know that the User Control works when it is in the same project and is compiled...
0
by: Bill | last post by:
Hi Everyone, I am having some difficulty in using the Windows Resource Localization Editor (WinRes.exe) on several Visual Basic .NET forms (.resx files) in two different projects. The editor...
8
by: David | last post by:
This is something I had never seen before. On an aspx page, upon pressing a link button for which I have an event handler in the code behind, the screen shows nothing but a line that says "true"...
3
by: dean4if | last post by:
I have 4 Windows 2000 Servers. I have installed the DotNet Framework 2.0 on all 4 servers. Three of these servers show a tab for ASP.NET in the IIS MMC and are running Visual Studio 2003. ...
1
by: Richard Carpenter | last post by:
I am trying to dynamically set the page title in the form load event of my master page, but the CurrentNode property doesn't seem to be available for some reason in the following code, the SiteMap...
2
by: Jeff | last post by:
Hey asp.net 2.0 My asp.net 2.0 project has got a assembly load problem: Some of my web.config settings: <membership defaultProvider="AH_MembershipProvider" userIsOnlineTimeWindow="15">
4
by: sqlguy | last post by:
Why do we have to contact MS for a problem that has been with this compiler from at least the beta of VS 20005. I am so sick and tired of the 30 - 40 clicks it takes to dismiss VS when there is a...
16
by: Bill Nguyen | last post by:
I'm running into a very weird problem regarding subtraction. Subtraction behaves as if it's an addition in the below sub txtJacoCost.Text = Format(mRackc - (mDisc + mJaEc), "0.#####0") ...
6
by: Author | last post by:
I have VS 2005 professional. Here is the version info: Microsoft Visual Studio 2005 Version 8.0.50727.762 (SP .050727-7600) &copy; 2005 Microsoft Corporation. All rights reserved. When I...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.