J
jeff
New VB user...developer...
Situation...simplified...
- I want to wrap a pre and post event around a system generated where the
pre-event will always execute before the system event and the post event
will always execuate after the system is completed...
- I want to wrap this functionality in a framework, so I could possibly have
3 or 4 levels of inherited objects that need to have these pre / post events
executed before and after the system event is starting and completed...
- basically, i want to be able to add a 'Post' event to the message queue
and have it executed after the system event is completed...
ie. button clicked ... post my event ... button done clicking, system does
what is does on a completed clicked ... my event that i posted runs now...
Example...simplified...
- I want to build to custom class inherited from the common command button.
- I want to add a 'pre-click' and a 'post-click' event to the buttons click
event ... and still allow the developer to use the clicked event...
so ... on my base class object ...
I add to custom subs/functions/events...whatever you want to call them to
the control...
ue_PreClick()
ue_PostClick() ...
in the click event i call them by....Click Event...
ue_preClick(...) ... calls the User Event - Pre-Click for the button...
POST ue_postClick() ... posts a User Event - Post-Click that will be
executed after the click event is completed...
Now, the sequence of events I am looking for is....
in any descendant class...if I code the pre-click event....the code will
execute before the click and postclick events...simple, this works.
now, in any descendant class...i want the post-click event to fire only when
the Click event is completed for the button...
So, for example...
ButtonBaseClass...base object inherited from the windows controls buttons
....
Add two functions...
uePreClick (arg...)
uePostClick(arg...)
Now, I inherit from this and create another button...
ButtonFirstChild
I place this code the the uePreClick
MessageBox.Show("Hello, I am in the PreClick Event")
I place this code in the uePostClick event ...
Messagebox.Show("Hello, I am in the PostClick Event")
and finalling, I put this code in the Clicked Event...system event...
Messagebox.show("Hello, I am in the Clicked Event")
So, when I click the button ... I want to see message boxes ...
PreClick...
Click...click is done...
PostClick...
So, my question is, is there anyway in the ancestor / parent / base class to
code it such that is will execute the events in this order ... I know I
could code three custom events .... uePreClick , ueClick, and uePostClick
.... and code accordingly, but what I am after here is I want the uePostClick
event to fire after the system Click event has completed...
Is this possible in VB .Net....this is a technique I user with Powerbuilder
and it works just fine...unfortunately, I can see not how to handle this is
VB...and help of guidance would be great...
the Application.DoEvent will flush the message queue but it will not
complete the current event before calling the 'POSTED' event...what I need
is the current event to be done ... than the post event fired.
Any help would be greatly appreciated...
Thanks
Jeff
Situation...simplified...
- I want to wrap a pre and post event around a system generated where the
pre-event will always execute before the system event and the post event
will always execuate after the system is completed...
- I want to wrap this functionality in a framework, so I could possibly have
3 or 4 levels of inherited objects that need to have these pre / post events
executed before and after the system event is starting and completed...
- basically, i want to be able to add a 'Post' event to the message queue
and have it executed after the system event is completed...
ie. button clicked ... post my event ... button done clicking, system does
what is does on a completed clicked ... my event that i posted runs now...
Example...simplified...
- I want to build to custom class inherited from the common command button.
- I want to add a 'pre-click' and a 'post-click' event to the buttons click
event ... and still allow the developer to use the clicked event...
so ... on my base class object ...
I add to custom subs/functions/events...whatever you want to call them to
the control...
ue_PreClick()
ue_PostClick() ...
in the click event i call them by....Click Event...
ue_preClick(...) ... calls the User Event - Pre-Click for the button...
POST ue_postClick() ... posts a User Event - Post-Click that will be
executed after the click event is completed...
Now, the sequence of events I am looking for is....
in any descendant class...if I code the pre-click event....the code will
execute before the click and postclick events...simple, this works.
now, in any descendant class...i want the post-click event to fire only when
the Click event is completed for the button...
So, for example...
ButtonBaseClass...base object inherited from the windows controls buttons
....
Add two functions...
uePreClick (arg...)
uePostClick(arg...)
Now, I inherit from this and create another button...
ButtonFirstChild
I place this code the the uePreClick
MessageBox.Show("Hello, I am in the PreClick Event")
I place this code in the uePostClick event ...
Messagebox.Show("Hello, I am in the PostClick Event")
and finalling, I put this code in the Clicked Event...system event...
Messagebox.show("Hello, I am in the Clicked Event")
So, when I click the button ... I want to see message boxes ...
PreClick...
Click...click is done...
PostClick...
So, my question is, is there anyway in the ancestor / parent / base class to
code it such that is will execute the events in this order ... I know I
could code three custom events .... uePreClick , ueClick, and uePostClick
.... and code accordingly, but what I am after here is I want the uePostClick
event to fire after the system Click event has completed...
Is this possible in VB .Net....this is a technique I user with Powerbuilder
and it works just fine...unfortunately, I can see not how to handle this is
VB...and help of guidance would be great...
the Application.DoEvent will flush the message queue but it will not
complete the current event before calling the 'POSTED' event...what I need
is the current event to be done ... than the post event fired.
Any help would be greatly appreciated...
Thanks
Jeff