A
Agnes
I created my own usercontrol of textbox and my base from . Every windows
will inhertied this mybaseform and every textbox will use that usercontrol.
Now, mybaseform got a function "public overridables function
fieldvalidation(byval _fieldname as string) as boolean"
in my usercontrol's validated event, I want to pass the textbox's name to
that function.
Can I do that ??
my aim ; in each windows form e.g frmInvoice, with a textbox,
txtInvNo,txtCompanyCode.
I want to use a "simple" and global way to pass the 'txtInvNo' to the
fieldvalidation()
public ..... function fieldvalidation(byval _field as string) as boolean
if _field = "txtInvNo" or _field = "CHECKALL"then
if me.txtInvNo.text.trim.length =0 then
messagebox.show("error")
blnFlag = false
end if
if _field = "txtCompanyCode" or _field = "CHECKALL"then
if me.txtInvNo.CompanyCode.trim.length =0 then
messagebox.show("error ")
blnFlag = false
end if
.........
end func
I want to create a BIG function to do the field valiation , instead of do it
in each textbox's validated event.
Anyone understand my question ?
Thanks in advance
will inhertied this mybaseform and every textbox will use that usercontrol.
Now, mybaseform got a function "public overridables function
fieldvalidation(byval _fieldname as string) as boolean"
in my usercontrol's validated event, I want to pass the textbox's name to
that function.
Can I do that ??
my aim ; in each windows form e.g frmInvoice, with a textbox,
txtInvNo,txtCompanyCode.
I want to use a "simple" and global way to pass the 'txtInvNo' to the
fieldvalidation()
public ..... function fieldvalidation(byval _field as string) as boolean
if _field = "txtInvNo" or _field = "CHECKALL"then
if me.txtInvNo.text.trim.length =0 then
messagebox.show("error")
blnFlag = false
end if
if _field = "txtCompanyCode" or _field = "CHECKALL"then
if me.txtInvNo.CompanyCode.trim.length =0 then
messagebox.show("error ")
blnFlag = false
end if
.........
end func
I want to create a BIG function to do the field valiation , instead of do it
in each textbox's validated event.
Anyone understand my question ?
Thanks in advance