event-handling subs running twice in derived class.
- From: johncee <johncee@xxxxxxxxxx>
- Date: Wed, 30 Nov 2005 11:12:12 -0800
Greetings,
I created a base class that has a datagrid. I've made it generic as
possible so that any derived classes pass some info to the base
constructor (including a SQL select stmt) & through the base class, any
db table can be displayed/maintained in the grid.
I've made some of the base class' event-handling subs overridable and in
some of the derived classes using the base, the subs are being
overridden:
Public Overrides Sub ToolBar1_ButtonClick(ByVal sender As
System.Object, ByVal e As
System.Windows.Forms.ToolBarButtonClickEventArgs) Handles
ToolBar1.ButtonClick
Overrides... "Handles Toolbar1.buttonClick" - My problem is that when
any button on the toolbar is clicked via a project with the derived
class, the sub in the derived class is called twice in a row. I've
gotten around this problem with a kludgy global variable that detects
the second consecutive call, but I don't like it and I know I must be
doing something wrong. It's not just the toolbar button click event but
apparently any overriding event-handling sub gets called (from the
derived class) twice.
Any ideas?
THANK YOU!
*** Sent via Developersdex http://www.developersdex.com ***
.
- Follow-Ups:
- Re: event-handling subs running twice in derived class.
- From: Marina
- Re: event-handling subs running twice in derived class.
- From: Mattias Sjögren
- Re: event-handling subs running twice in derived class.
- Prev by Date: Re: 'Then' is Optional?!?
- Next by Date: Query results from multiple table dataset
- Previous by thread: Re: #include equivalet..?
- Next by thread: Re: event-handling subs running twice in derived class.
- Index(es):