Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

FormLib And Modules

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-24-2010, 09:39 AM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default FormLib And Modules

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:

Quote:
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?
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!
Reply With Quote
  #2 (permalink)  
Old 04-24-2010, 09:56 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,734
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Timer doesn't really have a parent form. It is a global "control". So you can't move it between forms and actually it doesn't really matter as you can use it everywhere you need.
Reply With Quote
  #3 (permalink)  
Old 04-24-2010, 09:59 AM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

But I tried firing the tick event from the main module an it errors...
it never gets fired
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!
Reply With Quote
  #4 (permalink)  
Old 04-24-2010, 10:23 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,734
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

You should use AddEvent. In this example I have a timer in a module named mm.
Code:
Sub App_Start
    Form1.Show
    AddEvent(
"mm.timer1", Tick, "Timer1FromDifferentModule_tick")
    mm.Timer1.Enabled = 
True
End Sub
Sub Timer1FromDifferentModule_tick
    form1.Text = TimeS
End Sub
Reply With Quote
  #5 (permalink)  
Old 04-24-2010, 10:28 AM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Of course!!!!!!! I had forgot the AddEvent Keyword!!!!....

But can I use it this way?

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

The answer is......YES!!!!!!
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!

Last edited by Cableguy : 04-24-2010 at 10:31 AM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Modules and Libraries Zenerdiode Basic4ppc Wishlist 0 02-21-2010 10:44 AM
Loading Modules Smee Questions (Windows Mobile) 3 12-05-2009 09:05 AM
Modules tutorial Erel Tutorials 3 07-05-2009 05:52 PM
Some Modules klaus Code Samples & Tips 9 03-14-2009 03:25 PM
FormLib and modules Cableguy Questions (Windows Mobile) 3 10-23-2008 09:26 PM


All times are GMT. The time now is 10:48 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0