473,405 Members | 2,334 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,405 software developers and data experts.

using the validated event on textbox

Hello!

There is an event Validating that can be used on TextBox that are very
useful but
there are also an event named Validated that I can't find much use of.

Have you see any useful times where this event Validated can be used ?

//Tony
Jun 27 '08 #1
2 5687
Hi Tony,

Validated can be used to perform validating code that shouldn't be run if
Cancel is set in the Validating event. Granted, you could just put the code
in an if block in the Validating event as well, but separating the code to
Validated allows cleaner code. Particularly if someone overrides Validating
and forgets to add the 'Validated' code.

--
Happy Coding!
Morten Wennevik [C# MVP]
"Tony" wrote:
Hello!

There is an event Validating that can be used on TextBox that are very
useful but
there are also an event named Validated that I can't find much use of.

Have you see any useful times where this event Validated can be used ?

//Tony
Jun 27 '08 #2
On Jun 24, 4:42*am, "Tony" <johansson.anders...@telia.comwrote:
Hello!

There is an event Validating that can be used on TextBox that are very
useful but
there are also an event named Validated that I can't find much use of.

Have you see any useful times where this event Validated can be used ?

//Tony
Hi,

That you haven't used it yet (you will some day) it does not say is
not useful.
It's fired if and when the validating passed.
At that point you know that the value of the control is valid and you
can use it accordingky.

A simple example is that Validating check if the value is numeric , if
you get to validated you know for sure it's numeric and you can use it
for any calculation without the danger that it cannot be converted tu
number
Jun 27 '08 #3

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

Similar topics

4
by: Peloux | last post by:
Hi, I have written some htc in order to validate data in a form. most of htc are attached on 'onblur' event. Now, we would like to use the Enter Key to sublit form, so we use the following...
0
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...
0
by: charliewest | last post by:
I have an ASP.NET web form page, which includes a "search" include file. The search include file consists of a textbox, dropdownlist, and submit button. Both the textbox and dropdownlist have...
2
by: DesignerX | last post by:
I have a user control that contains a custom control, both are loaded dynamically. The custom control has a simple required field validator and a text box to validate. When the submit button...
1
by: Simon Verona | last post by:
I'm confused! I have a usercontrol which is basically an extension of the textbox - it is hosted in the user control because there are other controls held on the usercontrol as well. I have...
1
by: Tedmond | last post by:
Dear all, I have deployed my windows application to several user PCs with XP and Win2000. However, there is something strange that ONE of the TextBox Validated event doesn’t fire in ONE of...
5
by: =?Utf-8?B?QmVuIFIu?= | last post by:
Hi, In a .NET 2.0 winforms application, I've got a textbox that, when updated, uses the validated event to cascade the change to another textbox (along with another value). This works well if...
1
by: Gohalien | last post by:
Hi, I want to execute an event (in this case Validated event) by code, it can also be a Lostfocus event, I was searching around the web and reading, I cant find the way to do this with any event,...
8
by: Greg (codepug | last post by:
For lack of the proper expression, how do I excite a control to cause events to trigger. I have a date control and am using a calender form button to fill the text box with the date. The text box...
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: 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...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.