Heiko
Well-known member
Huh. I hope I can make the problem quite clear.
I have defined an extended Textbox class. This class has a builtin public validation routine (know if it is mandatory, for example).
On my forms I have a lot of these extended textboxes.
Now what I want to do is the following:
In some cases there are some additional validations to be made.
Is there a way to pass a
to a single instance of an extendedTextbox?
Would I have to declare a delegate?
Then, in the already coded "Validate" Function I could perhaps simply check if the delegate is not nothing and then execute it.
How can I pass from the "outside" the delegate to handle the custom validation ?
In the form would like to have something like:
and in the extended textbox:
Does this make sense?
(Sorry if I sound confused. I actually am. Thats why I am leaving the office right now
)
I have defined an extended Textbox class. This class has a builtin public validation routine (know if it is mandatory, for example).
On my forms I have a lot of these extended textboxes.
Now what I want to do is the following:
In some cases there are some additional validations to be made.
Is there a way to pass a
Code:
Function CustomValidatior (byval Origin as Control) as string
Would I have to declare a delegate?
Then, in the already coded "Validate" Function I could perhaps simply check if the delegate is not nothing and then execute it.
How can I pass from the "outside" the delegate to handle the custom validation ?
In the form would like to have something like:
Code:
Dim ctlPhone as new ctlExtendedTextbox ()
ctlPhone.CustomValidator = AddressOf Utility.ValidatePhone()
and in the extended textbox:
Code:
Public Sub Validate ()
Do stuff
Try
returnString = mCustomValidator (me)
Well how do I figure out if there actually *is* a customValidator?
End Try
End Sub
Does this make sense?
(Sorry if I sound confused. I actually am. Thats why I am leaving the office right now
