help with timer
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Thread: help with timer

  1. #1
    Join Date
    Mar 2013
    Posts
    4

    Question help with timer

    Hallo

    Just need the variable to get the action sleep for defined time written in 'textbox3.text'


    Dim x As Integer = 1
    Dim i As Integer = 0

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
    For Me.x = 1 To 10

    TextBox2.Text = TextBox1.Text & Me.i

    If Me.x > 0 Then
    'do something
    ' HERE SHOULD BE THE VARIABLE TO GET THE WHOLE ACTION SLEEP FOR TIME (textbox3.text)
    End If


    Next
    Share on Google+

  2. #2
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008
    Location
    WV
    Posts
    4,860

    Re: help with timer

    I have no idea what you mean by "get the action sleep"
    Always use [code][/code] tags when posting code.
    Share on Google+

  3. #3
    Join Date
    Mar 2013
    Posts
    4

    Re: help with timer

    it should pause for 6sec every loop, but not freeze, just do nothing 6 sec
    Share on Google+

  4. #4
    Join Date
    Aug 2009
    Location
    NW USA
    Posts
    173

    Re: help with timer

    What's the difference between "do nothing" and "freeze"? If it's not frozen then it is doing something, right?
    Share on Google+

  5. #5
    Join Date
    Mar 2013
    Posts
    4

    Re: help with timer

    <-- comment deleted by mod -->

    and specially for u, freeze ( app not responding, flattering etc.), 'do nothing' (waiting for some time to do something)
    One guy post on other forum, '' u want to freeze ur app, is that what u wanna do ?''
    I dont wanna pause the program
    Last edited by DataMiser; March 6th, 2013 at 12:21 PM.
    Share on Google+

  6. #6
    Join Date
    Aug 2009
    Location
    NW USA
    Posts
    173

    Re: help with timer

    looks like you should try an anger managment forum
    Share on Google+

  7. #7
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008
    Location
    WV
    Posts
    4,860

    Re: help with timer

    When you put your app to sleep it does nothing which means it is frozen.

    You would use a timer to make something happen at given intervals, sleep to halt execution for a given interval

    You can but should not use a busy loop to cause your code to not go past the loop for a given time but again this will effectively freeze your app unless you have a doevents in there and that will allow other stuff to happen so that does not sound like what you want.

    In the future you should try to give the best description possible of what you are trying to do and do not insult other members of the forum.
    Last edited by DataMiser; March 7th, 2013 at 01:40 AM.
    Always use [code][/code] tags when posting code.
    Share on Google+

  8. #8
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008
    Location
    WV
    Posts
    4,860

    Re: help with timer

    When you put your app to sleep it does nothing which means it is frozen.

    You would use a timer to make something happen at given intervals, sleep to halt execution for a given interval

    You can but should not use a busy loop to cause your code to not go past the loop for a given time but again this will effectively freeze your app unless you have a doevents in there and that will allow other stuff to happen so that does not sound like what you want.

    In the future you should try to give the best description possible of what you are trying to do and do not insult other members of the forum.
    Always use [code][/code] tags when posting code.
    Share on Google+

  9. #9
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,099

    Re: help with timer

    akmaggot666, please refrain from calling people names. Also, please do not report posts unecessarily with foul language.

    This is a peaceful forum. We are all here to help.

    I am closing this thread now.

    Thanks DM for cleaning up this thread
    Share on Google+

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center