FormLib And Modules

Cableguy

Expert
Licensed User
Longtime User
Hi guys...

I have a few modules in a project of mine and I am tiding things up...
I have a module called "components" were I create all controls in runtime and add all DLL objects I require...
Now I was hopping to move all the controls and Objects SUBs to the main module, so that only the initialization of the components were in the components module...
I added FormLib to allow me to change the parent of a control, so far so good, now I'm getting this message when I try to change the parent of a Timer created in the components module to the Main module form:

Object of type 'DBasic.EnhancedControls.CEnhancedTimer' cannot be converted to type 'System.Windows.Forms.Control'

Why?
I want to be able to execute an event in a diferent module of the one the control was created on...How?
 

Cableguy

Expert
Licensed User
Longtime User
But I tried firing the tick event from the main module an it errors...
it never gets fired
 

Cableguy

Expert
Licensed User
Longtime User
Of course!!!!!!! I had forgot the AddEvent Keyword!!!!....

But can I use it this way?

AddEvent("timer1", Tick, "mm.Timer1FromDifferentModule_tick")
were "mm" is the name of the module were the event sould fire

The answer is......YES!!!!!!
 
Last edited:
Top