|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Inherited handler problem.I've problem with button click handler. In a short brief my program looks like this: there is form invoice with is base class for invoice_edit form. invoice form has public button "save" with modifers option set to public invoice_edit form has method which handles save.click and do some code Public Sub save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles save.Click there is third form invoice_prod which inherits from invoice_edit and also handles "save" button with this method declaration: Public Sub save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles save.Click So, when I launch my invoice_prod: invoice_prod.ShowDialog() and click on "save" button involved with public sub save_click from form invoice_edit executing. Please help, how to execute method from invoice_prod form. I'm sorry, I'm confused. Is this right:
You have a base class form form called invoice_edit that has a Save method in it. You have a form that inherits from invoice_edit that is called invoice. This has a "save" button on it. You have a form that inherits from invoice_edit that is called invoide_prod. This has a "save" button on it. Is that right? So what's the problem exactly? Robin S. ------------------------------------ Show quoteHide quote "kosecki" <piotrkosin***@gmail.com> wrote in message news:1164228951.634318.300320@m73g2000cwd.googlegroups.com... > Hi, > > I've problem with button click handler. > > In a short brief my program looks like this: > > there is form invoice with is base class for invoice_edit form. > > invoice form has public button "save" with modifers option set to > public > > invoice_edit form has method which handles save.click and do some code > > Public Sub save_Click(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles save.Click > > there is third form invoice_prod which inherits from invoice_edit and > also handles "save" button with this method declaration: > > Public Sub save_Click(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles save.Click > > So, when I launch my invoice_prod: > > invoice_prod.ShowDialog() and click on "save" button involved with > public sub save_click from form invoice_edit executing. > > Please help, how to execute method from invoice_prod form. > Kosecki,
Do you mean that you want to shadows the method of your last button? http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vakeyShadows.asp Cor Show quoteHide quote "kosecki" <piotrkosin***@gmail.com> schreef in bericht news:1164228951.634318.300320@m73g2000cwd.googlegroups.com... > Hi, > > I've problem with button click handler. > > In a short brief my program looks like this: > > there is form invoice with is base class for invoice_edit form. > > invoice form has public button "save" with modifers option set to > public > > invoice_edit form has method which handles save.click and do some code > > Public Sub save_Click(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles save.Click > > there is third form invoice_prod which inherits from invoice_edit and > also handles "save" button with this method declaration: > > Public Sub save_Click(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles save.Click > > So, when I launch my invoice_prod: > > invoice_prod.ShowDialog() and click on "save" button involved with > public sub save_click from form invoice_edit executing. > > Please help, how to execute method from invoice_prod form. > kosecki wrote:
Show quoteHide quote > Hi, When inheriting visual classes, it is *far* better to provide an > > I've problem with button click handler. > > In a short brief my program looks like this: > > there is form invoice with is base class for invoice_edit form. > > invoice form has public button "save" with modifers option set to > public > > invoice_edit form has method which handles save.click and do some code > > Public Sub save_Click(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles save.Click > > there is third form invoice_prod which inherits from invoice_edit and > also handles "save" button with this method declaration: > > Public Sub save_Click(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles save.Click > > So, when I launch my invoice_prod: > > invoice_prod.ShowDialog() and click on "save" button involved with > public sub save_click from form invoice_edit executing. > > Please help, how to execute method from invoice_prod form. Overridable method that performs each action, rather than attaching event handlers. I haven't found any way of finding out which, if any, event handlers exist for a given event and, if you can manipulate them in code, you can't guarantee the order in which the event handlers might run. Going down the "overriding" route, you'd have something like this: Class InvoiceForm Protected WithEvents save As Button Protected Overridable Sub OnSaveClick() ' Basic functionality goes here End Sub Private Sub save_Click( ... ) Handles save.Click Me.OnSaveClick() End Sub End Class Class Invoice_Edit Inherits InvoiceForm Protected Overrides Sub OnSaveClick() ' *Alternative* functionality goes here ' ' To use the code in InvoiceForm.OnSaveClick, use ' MyBase.OnSaveClick() End Sub End Class Class Invoice_Prod Inherits Invoice_Edit Protected Overrides Sub OnSaveClick() ' Alternative functionality goes here ' ' To use the code in Invoice_Edit.OnSaveClick, use ' MyBase.OnSaveClick() ' NB: You cannot access /InvoiceForm/.OnSaveClick directly End Sub End Class HTH, Phill W. kosecki wrote:
Show quoteHide quote > Hi, When inheriting visual classes, it is *far* better to provide an > > I've problem with button click handler. > > In a short brief my program looks like this: > > there is form invoice with is base class for invoice_edit form. > > invoice form has public button "save" with modifers option set to > public > > invoice_edit form has method which handles save.click and do some code > > Public Sub save_Click(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles save.Click > > there is third form invoice_prod which inherits from invoice_edit and > also handles "save" button with this method declaration: > > Public Sub save_Click(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles save.Click > > So, when I launch my invoice_prod: > > invoice_prod.ShowDialog() and click on "save" button involved with > public sub save_click from form invoice_edit executing. > > Please help, how to execute method from invoice_prod form. Overridable method that performs each action, rather than attaching event handlers. I haven't found any way of finding out which, if any, event handlers exist for a given event and, if you can manipulate them in code, you can't guarantee the order in which the event handlers might run. Going down the "overriding" route, you'd have something like this: Class InvoiceForm Protected WithEvents save As Button Protected Overridable Sub OnSaveClick() ' Basic functionality goes here End Sub Private Sub save_Click( ... ) Handles save.Click Me.OnSaveClick() End Sub End Class Class Invoice_Edit Inherits InvoiceForm Protected Overrides Sub OnSaveClick() ' *Alternative* functionality goes here ' ' To use the code in InvoiceForm.OnSaveClick, use ' MyBase.OnSaveClick() End Sub End Class Class Invoice_Prod Inherits Invoice_Edit Protected Overrides Sub OnSaveClick() ' Alternative functionality goes here ' ' To use the code in Invoice_Edit.OnSaveClick, use ' MyBase.OnSaveClick() ' NB: You cannot access /InvoiceForm/.OnSaveClick directly End Sub End Class HTH, Phill W.
get values from asp pass to batch file !!!
A Modest Question Is VB.NET Stable?? Odd databinding behavior create a keystroke logger Need to create link between DataSet tables to show matching records Restart a Sub and keep loop going Simple Data UPdae Question Why must I cast when I put type safe generic objects in the combo box? Adapter Update...Syntax error |
|||||||||||||||||||||||