473,499 Members | 1,765 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Event question ?

As the user input the customercode, I will check the customercode is valid
or not in "validateded event". Well, as the user save the invoice, I would
like to do the validation again.

it seems too dummy that I write another same code about this. Can I re-user
the validated event" ?
Nov 20 '05 #1
4 877
Hi Agnes,

In my opinion it is the nicest to make something as this

myvalidate event
doValidating

myclosing event
doValidating

private sub doValidating
......

However there are very much other solutions, and I can not say I do this
myself forever.

I hope this helps?

Cor
As the user input the customercode, I will check the customercode is valid
or not in "validateded event". Well, as the user save the invoice, I would
like to do the validation again.

it seems too dummy that I write another same code about this. Can I re-user the validated event" ?

Nov 20 '05 #2
In my old vfp application, I use the same concept as U.
I got 10 textboxes to be validated, I will call another event to check the
data again.
I am wonder whether .net got another solution (I thought my old ways in vfp
are too stupid)
But now, i think I know how to design the validated flow
Thanks

"Cor Ligthert" <no**********@planet.nl> ¦b¶l¥ó
news:e2**************@TK2MSFTNGP10.phx.gbl ¤¤¼¶¼g...
Hi Agnes,

In my opinion it is the nicest to make something as this

myvalidate event
doValidating

myclosing event
doValidating

private sub doValidating
.....

However there are very much other solutions, and I can not say I do this
myself forever.

I hope this helps?

Cor
As the user input the customercode, I will check the customercode is valid or not in "validateded event". Well, as the user save the invoice, I would like to do the validation again.

it seems too dummy that I write another same code about this. Can I

re-user
the validated event" ?


Nov 20 '05 #3
Hi Agnes,

There are other methods I said. This is the most easy one. However needs
some typing, you can also add an event to an array of your textboxes and
than use a select case in that "doValidating" depending on the sender (which
can as well be the close)

I hope this helps?

Cor
Nov 20 '05 #4
Agnes,
I got the following tip from "Windows Forms Programming in C#" by Chris
Sells, from Addison Wesley.

Within your "Accept" button click handler (the "save" button) process each
control that CausesValidation to ensure that they are all valid...

Something like:

For Each control As control In Me.Controls
If control.CausesValidation Then
control.Focus()
If Not Me.Validate() Then
Me.DialogResult = DialogResult.None
Exit For
End If
End If
Next

Note this version does not validate controls nested within other container
controls, such as GroupBoxes, I would include the above in a recursive
subroutine.

The above code will cause the Validating event for each of your controls to
be raised, ensuring that all the controls get validated, before the dialog
is closed or the data is saved...

Hope this helps
Jay
"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:OF**************@TK2MSFTNGP10.phx.gbl...
As the user input the customercode, I will check the customercode is valid
or not in "validateded event". Well, as the user save the invoice, I would
like to do the validation again.

it seems too dummy that I write another same code about this. Can I re-user the validated event" ?

Nov 20 '05 #5

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

Similar topics

0
7007
by: Andy Read | last post by:
Hello all, I have the requirement to produce source code that produces an object hierarchy. Example: Root | Folder 1
18
2849
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code...
8
6070
by: Mark | last post by:
Hi, I'm looking for some ideas on how to build a very simple Event processing framework in my C++ app. Here is a quick background ... I'm building a multithreaded app in C++ (on Linux) that...
2
4975
by: Alex Sedow | last post by:
Why interface-event-declaration does not support multiple declarators like event-declaration? Grammar from C# spec: variable-declarators: variable-declarator variable-declarators ","...
13
3478
by: Charles Law | last post by:
Mr "yEaH rIgHt" posted the following link about a week ago in answer to my question about removing event handlers. > http://www.vbinfozine.com/t_bindevt.shtml Following on from that post, the...
12
4102
by: Jack Russell | last post by:
My unstanding of all VB up to and including vb6 is that an event could not "interrupt" itself. For instance if you had a timer event containing a msgbox then you would only get one message. ...
41
4236
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based...
9
2454
by: jeff | last post by:
New VB user...developer... Situation...simplified... - I want to wrap a pre and post event around a system generated where the pre-event will always execute before the system event and the...
19
4721
by: Daniela Roman | last post by:
Hello, I try to fire an event under a button click event and maybe anybody can give a clue please. I have let's say a WEB grid with PageIndexChanged event: private void...
5
4517
by: jaysonnward | last post by:
Hello All: I've recently been recreating some 'dropdown menus' for a website I manage. I'm writing all my event handlers into my .js file. I've got the coding to work in Firefox, but the...
0
7128
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,...
0
7169
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
7215
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...
0
7385
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...
0
5467
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,...
1
4917
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...
0
3096
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...
0
1425
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 ...
1
661
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.