How can reference the window generically i.e
What I want to do....
{Event Clicked for CB_1}
...
...
lpw_parentwindow = Tabcontrol.GetParent()
lpw_parentwindow.Trigger Event ue_process()
This don't work!!
Thanks
Ken
Ken wrote in message ...
You don't mention the data type of lpw_parentwindow, but I assume it is type
Window. The window datatype does not have the event ue_process. So, the
compiler can't let you call an event that does not exist in type Window.
However, you know that at runtime the lpw_parentwindow variable will contain
a reference to a descendant of Window that does have the ue_process event.
The dynamic keyword tells the compiler not to check the event or function
call. At run-time, PB finds the event in the actual object referenced by
lpw_parentwindow. If the event does not exist, PB ignores the event call and
moves on in the code. If you call a function in this way and the function
does not exist, PB will raise a run-time error.
Another approach to your problem:
w_desc lpw_parentwindow // substitute the window class that contains the
ue_process event
lpw_parentwindow = Tabcontrol.GetParent()
lpw_parentwindow.Trigger Event ue_process()
You can take this approach if you are absolutely certain that the parent of
Tabcontrol will always be of class w_desc or a descendant of w_desc. If it
isn't, then the GetParent assignment will cause a type mismatch runtime
error.
Regards
Ken
Stephanie Giovannini wrote in message ...