Form : Auto Refresh

This forum can be browsed by the general public. Posting is no longer allowed as the product has been discontinued.
This topic is 15 years and 3 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
briam
Posts: 2
Last visit: Tue May 05, 2009 10:52 pm

Form : Auto Refresh

Post by briam »

I love primal form!!

I was able to creat a little form with some useful information for our group. We want to put this up on our dashboard, but I am not sure how to make the form update every X minutes... The amount of time is not important, I just dont know how.

Please help.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Form : Auto Refresh

Post by davidc »

You will need to use a Timer; unfortunately the Timer is not available in PrimalForms until the next service release.

Since it is not available, you can use the following script to create a timer:

Code: Select all

$timer1 = New-Object System.Windows.Forms.Timer
$timer1.Interval = 1000 #1 second time interval
$timer1.add_Tick($OnTickEvent)
$timer1.Start(); #Start the timer
Replace the $OnTickEvent with your own custom script block. Note that the timer will only fire while the Form is idle.

I recommend using ScriptingAnswers for any future scripting questions you may have.


David
davidc2008-12-17 11:24:50
David
SAPIEN Technologies, Inc.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Form : Auto Refresh

Post by davidc »

If you want to update every minute, use 60000 for the time interval.
David
SAPIEN Technologies, Inc.
User avatar
briam
Posts: 2
Last visit: Tue May 05, 2009 10:52 pm

Form : Auto Refresh

Post by briam »

Thank you for the quick response. I will give it a try (and next time use the scriptinganswers...
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Form : Auto Refresh

Post by davidc »

You're welcome and please let me know if it works out for you.

I mentioned ScriptingAnwsers because these forums are reserved for questions and issues about the Free Tools. In addition you will get a better response when it comes to scripting questions.
User avatar
jhicks
Posts: 1789
Last visit: Mon Oct 19, 2015 9:21 am

Form : Auto Refresh

Post by jhicks »

I posted a sample form and script that uses a timer to auto refresh.http://www.sapien.com/blog/2008/12/18/w ... nd-timers/
This topic is 15 years and 3 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.