Thanks.
Further Question:
Can I do the inheritance as follows?
1. Inherit TextBox
2. Create a new property ID
3. code the SETID procedure like this:
if ID="CUSTOMER" then
get database content
if something then .backcolor=color.green
if ...
end if
4. Will this new control appear on the toolsbox, so that I can drag it on
the form?
Thanks.
Benson.
"Phill W." <p-.-a-.-w-a-r-d@o-p-e-n-.-a-c-.-u-k>
???????:epqdvs$ekf$(E-Mail Removed)...
> Benson Wong wrote:
>
>> I want to write a tailor-made function or class to amend textedit
>> controls,
>> so that their properties are consistent or changed by some rules.
>
> Inherit a class of your own from TextBox and customise to your heart's
> content.
>
> When dealing with events in your class, extend the On* routines rather
> than attaching event handlers, something like
>
> Protected Overrides Sub OnLeave(ByVal e as EventArgs)
> ' Do the custom thing
> Me.BackColor = Color.Green
>
> ' Get the TextBox to raise the Leave event
> MyBase.OnLeave(e)
>
> End Sub
>
> HTH,
> Phill W.
|