Results 1 to 5 of 5

Thread: Refreshing at specified time[RESOLVED]

  1. #1

    Thread Starter
    Addicted Member perlmonk's Avatar
    Join Date
    Jan 2005
    Posts
    138

    Resolved Refreshing at specified time[RESOLVED]

    On my form, I have a provision for users to call a subroutine by clicking on a button (lets say "ABC").
    So, every time the user clicks ABC, the subroutines kicks off, returns the data onto the form in a listview box.

    Now, I want to add functionality for an autorefresh...So, I want to add a command button with a textbox asking the user if he wants to autorefresh the app every ___x___ seconds. The subroutine shud be called every x amount of seconds that the user enters (after the command button is clicked).

    I believe I can use timer for this functionality...but, Im struggling to add an event into the timer sub, and I have not been able to find the correct solution in the archives.

    Any help will be appreciated!!
    Last edited by perlmonk; Feb 28th, 2005 at 04:14 PM.

  2. #2
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: Refreshing at specified time

    Add an event in the timer sub? Can't you just use the Timer event, and set the interval to what ever is written in your text box?



    ØØ

  3. #3

    Thread Starter
    Addicted Member perlmonk's Avatar
    Join Date
    Jan 2005
    Posts
    138

    Re: Refreshing at specified time

    Quote Originally Posted by NoteMe
    Add an event in the timer sub? Can't you just use the Timer event, and set the interval to what ever is written in your text box?



    ØØ
    i guess I am wondering wht a timer event is?
    will the timer subroutine get called every time when the timer interval is up?

    VB Code:
    1. Private Sub Timer1_Timer()
    2.  
    3. 'lets say "refresh.text holds the value of the refresh time
    4. timer1.interval = refresh.text
    5.  
    6. call sub_abc()
    7.  
    8.  
    9. End Sub

    is that the right way to go about it?

  4. #4
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: Refreshing at specified time

    Quote Originally Posted by perlmonk
    i guess I am wondering wht a timer event is?
    will the timer subroutine get called every time when the timer interval is up?

    VB Code:
    1. Private Sub Timer1_Timer()
    2.  
    3. 'lets say "refresh.text holds the value of the refresh time
    4. timer1.interval = refresh.text
    5.  
    6. call sub_abc()
    7.  
    8.  
    9. End Sub

    is that the right way to go about it?

    Yeah that is the way. But I would have taken out the

    timer1.interval = refresh.text

    line, and added it to a command buttons click event or something. And remember that the timers Interval property is milli seconds. So 1000 is 1 second.


    ØØ

  5. #5

    Thread Starter
    Addicted Member perlmonk's Avatar
    Join Date
    Jan 2005
    Posts
    138

    Re: Refreshing at specified time

    gotcha...thanks!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width