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.

Showing time in textbox ???

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-11-2009, 09:02 AM
Junior Member
 
Join Date: Jan 2009
Posts: 28
Default Showing time in textbox ???

How on earth do i show the actual time as text and not as messagebox ??

Msgbox (Time (Now)) Shows in Msgbox

But how to implement in a Textbox or as regular Text ???

Reply With Quote
  #2 (permalink)  
Old 01-11-2009, 09:22 AM
taximania's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Derbyshire. UK
Posts: 592
Awards Showcase
Beta Tester 
Total Awards: 1
Default

label1.text=time(now)
form1.refresh
__________________
.
.
.
Don't ask, I'm fine, honest. !!
.
.
.
Just a little crazy at times



O2 XDA, GW Evo 2.1 UC WWE Rom, WM6.1
Radio Ver 03.34.90
With Basic4ppc V6.80


http://www.taximania.co.uk
Reply With Quote
  #3 (permalink)  
Old 01-11-2009, 09:45 AM
Junior Member
 
Join Date: Jan 2009
Posts: 28
Default

Quote:
Originally Posted by taximania View Post
label1.text=time(now)
form1.refresh

Thanx, but it only shows what the time is when i start the app and not updating it.

Will try to solve it by myself but some hints whould be nice =)
Reply With Quote
  #4 (permalink)  
Old 01-11-2009, 09:51 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

Just add a timer to your form, set the timer interval to around 200...
Put these lines in...

Sub Timer1_tick
textbox1.Tetx=Time(Now))
End Sub
__________________
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
  #5 (permalink)  
Old 01-11-2009, 10:18 AM
Junior Member
 
Join Date: Jan 2009
Posts: 28
Default

Quote:
Originally Posted by Cableguy View Post
Just add a timer to your form, set the timer interval to around 200...
Put these lines in...

Sub Timer1_tick
textbox1.Tetx=Time(Now))
End Sub

Ghaaa, i must be a total idiot but can't get it to work..
Did as u said, added Timer and set it to 200..
Whats wrong:

Sub Globals
'Declare the global variables here.

End Sub
Sub App_start

Form1.show
label1.FontSize = 32

End Sub



Sub Timer1_Tick

label1.text=Time(Now)

End Sub
Reply With Quote
  #6 (permalink)  
Old 01-11-2009, 10:27 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

Quote:
Sub Globals
'Declare the global variables here.

End Sub
Sub App_start

Form1.show
label1.FontSize = 32
Timer1.Enabled=True
End Sub



Sub Timer1_Tick

label1.text=Time(Now)

End Sub
You MUST do some researh in the help files...That way you would have noticed that the timer cantrol can be turned off/on
__________________
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
  #7 (permalink)  
Old 01-11-2009, 10:31 AM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 4,463
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

Do you know that there does exist a help file ?

Timers are used to generate events every measured time.
When a Timer is created its Enabled property is set to false.
To start the Timer, set its Enabled property to true.
Properties and Methods:
Enabled
Interval
Events:
Tick


You must enable the Timer with
Timer1.Enabled = True

Best regards.
__________________
Klaus
Switzerland

Beginner's Guide / User's Guide
Reply With Quote
  #8 (permalink)  
Old 01-11-2009, 10:32 AM
Junior Member
 
Join Date: Jan 2009
Posts: 28
Default

Quote:
Originally Posted by Cableguy View Post
You MUST do some researh in the help files...That way you would have noticed that the timer cantrol can be turned off/on

The Timer should be On by the default one can think........
Reply With Quote
  #9 (permalink)  
Old 01-11-2009, 10:34 AM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 1,057
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Basseman View Post
Ghaaa, i must be a total idiot but can't get it to work..


What about reading the help file instead of "missreading" other code snipplets?

I cant' see any timer here. Maybe you have added it in the desingner but where do you set the timer value and where do you activate it?

Small hint: The excellent help files could be found here and ind the IDE within the menu "Help".

So a good starting point to your question would be the tickevent.


specci48


Edit: Sorry Cableguy and Klaus: a bit late, but the same intention...

Last edited by specci48 : 01-11-2009 at 10:38 AM.
Reply With Quote
  #10 (permalink)  
Old 01-11-2009, 10:36 AM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 1,057
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Basseman View Post
The Timer should be On by the default one can think........
Basic4ppc does not run like you think but as you implement...
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
Date and Time Erel Tutorials 6 01-28-2010 11:01 PM
Time Zone alfcen Basic4ppc Wishlist 8 10-05-2007 05:47 AM
Time Addition busboy Questions (Windows Mobile) 3 10-01-2007 01:41 PM
.NET 3.0 and 3.5 / Time Zone alfcen Questions (Windows Mobile) 3 08-23-2007 05:58 PM
Showing a form in a SelectionChanged event specci48 Questions (Windows Mobile) 3 05-18-2007 02:05 PM


All times are GMT. The time now is 03:40 AM.


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