473,795 Members | 2,924 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5709
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.ande rs...@telia.com 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
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
7604
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 code : ----------- <SCRIPT> function touche_EnterKeyPress(){
0
1066
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?
0
901
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 their respective RequiredFieldValidation controls that ensure that when the user clicks the search button, the textbox and ddl are properly completed. The problem surfaces when this include is inserted in a web form page, that contains it's own...
2
1618
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 in the user control is pressed the textbox does not seem to be validated. How do I even begin to troubleshoot this?
1
2595
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 code that I've put in the mybase.validated event that validates data and does other work. This should run as the user exits the usercontrol (ie tabs out of the textbox or clicks on another control). 99.9% of the time it does, but in some...
1
1297
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 the PC. Basically, the service pack and the .Net framework are same. I could not find out what cause the problem from that PC. Does anyone has such experience before and tell me why and how to solve it? Thanks for any help!
5
7460
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 the user does indeed move the cursor to another textbox, but if the user clicks my "done" toolstripbutton after making a change in the textbox but without moving the cursor out, the validated event never fires. I have a pretty bad workaround where...
1
1084
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, maybe it is not possible ? If it is, please, anyone can explain me how ?
8
2173
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 is bound to a field. All this works great, but now the date range validation is not not working and the after update event that did calculations is not working. This is without question the result of the control not firing because I'm using...
0
9672
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
9519
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
10215
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...
0
10001
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
9043
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
7541
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
6783
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
5437
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...
1
4113
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

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.