Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Using Timer To Close MsgBox?


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-08-2008, 05:38 PM
Knows the basics
 
Join Date: Aug 2007
Location: Arkansas
Posts: 52
Default Using Timer To Close MsgBox?

How can I close out a MsgBox after 5 sec. of show time?
Reply With Quote
  #2 (permalink)  
Old 05-08-2008, 05:48 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,964
Default

Interesting question with a nice solution:
Code:
Sub App_Start
    Form1.Show
    Hardware1.New1
    timer1.Interval = 5000
    timer1.Enabled = true
    Msgbox("Some Message","title",cMsgboxOK)
    timer1.Enabled = false    
End Sub

Sub Timer1_Tick
    Timer1.Enabled = False
    Hardware1.KeyPress(13)
End Sub
Reply With Quote
  #3 (permalink)  
Old 05-08-2008, 06:07 PM
Knows the basics
 
Join Date: Aug 2007
Location: Arkansas
Posts: 52
Default

Thanks Erel

That's the ticket.
Reply With Quote
  #4 (permalink)  
Old 05-09-2008, 11:06 AM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 482
Awards Showcase
Beta Tester 
Total Awards: 1
Default

@Erel,
How is this possible?
I would have expected to need DoEvents or Agraham's Threading library as I thought the MsgBox would normally halt program execution.
Yet it is obvious here that the Tick events are still caught even though the program is in the middle of running App_Start.

Regards,
RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #5 (permalink)  
Old 05-09-2008, 11:14 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,964
Default

While the main (and only) thread waits for the msgbox to be closed it is free to handle other events.
Most user events will not happen as the form and all its controls are blocked until the msgbox is closed, however the timer continues to raise events.
Reply With Quote
  #6 (permalink)  
Old 05-09-2008, 11:20 AM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 482
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Thanks for the response, I understand now.
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
cTicksPerDay: optimised compilation error with timer LineCutter Bug Reports 2 04-21-2008 06:15 PM
How to use timer to clock speed of subs? Stellaferox Questions & Help Needed 4 02-28-2008 07:07 AM
out-of-memory-error based on timer after switching to V6 Frank Questions & Help Needed 2 01-17-2008 03:26 PM
Msgbox Vito Questions & Help Needed 2 11-19-2007 08:05 AM
Event Countdown Timer dlfallen Share Your Creations 0 06-08-2007 05:48 AM


All times are GMT. The time now is 11:39 PM.


Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0