Thanks for assistance, but I am still running into a wall. (I guess you
could blame it on my ignorance). So I applogize in advance for drilling down
deaper into this one.
If I remove the MyBase.OnTextChanged(e) then wouldn't the base class be
raised rather then the form's event? I guess what I am trying to do (10,
000 foot view) is to have a generic routine in the base class that handles
my dataset updates. Let's say in the textbox_leave event of the base class.
However, I only want this event to be raised when control validation (on the
inherited form) has been performed. Let's say that this is done on the
inherited control. Something like this:
On the form: (I'll keep it simple again)
Private Sub TextBoxBase1_Leave(ByVal sender As Object, ByVal e As
System.EventArgs) Handles TextBoxBase1.Leave
'Handle control validaion (I.e. not empty or check if the text changed)
'If we pass then call then raise the base event to update the dataset
'else get the heck outta here
End Sub
Base class:
Protected Overrides Sub OnLeave(ByVal e As System.EventArgs)
'perform the update
End Sub
Thanks again
Regards
-Chris
P.S. In VFP I've worked with nodefault/dodefault to handle situations like
these. A simple nodefault --> run my validation --> dodefault() would do the
trick.
"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:eP**************@TK2MSFTNGP12.phx.gbl...
Hello,
"crk2" <yx**@xxxyyy.com> schrieb: Here a simple one. (At least I think it is?) and any help would be
truly appreciated.
I have an inherited textbox on my form based on a custom texbox control.
It looks something like this (I'll keep it simple)
Base Class:
Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
MyBase.OnTextChanged(e)
Remove the line above.
MsgBox("In the class")
End Sub
Inherited Object (on the form):
Public Sub TextBoxBase1_TextChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles TextBoxBase1.TextChanged
MsgBox("In the form")
End Sub
I want to see how I can prevent the base classes ontextchanged event
from firing and override the base's code and handle everything on the form.
I'm sure it's probably a simple question, but for a fairly new .net'er , it
got me stumped...
See inline comment.
Regards,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet