Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Timer with 2 seconds

Timer with 2 seconds

Scheduled Pinned Locked Moved Visual Basic
helptutorialquestion
10 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    member27
    wrote on last edited by
    #1

    Hi I want to open a note pad for every 2 seconds by setting a timer control.. can anyone can help?? Dim t As New Timer t.Interval = 500 t.Start() process.Start("notepad.exe") I didnt complete the code any one can help? I dont know how to put loop for opening a note pad for each 2 second

    S A L 3 Replies Last reply
    0
    • M member27

      Hi I want to open a note pad for every 2 seconds by setting a timer control.. can anyone can help?? Dim t As New Timer t.Interval = 500 t.Start() process.Start("notepad.exe") I didnt complete the code any one can help? I dont know how to put loop for opening a note pad for each 2 second

      S Offline
      S Offline
      Smithers Jones
      wrote on last edited by
      #2

      Drag the timer-icon from the toolbox onto your form. Set its interval = 2000 (milliseconds). Create the timer-tick-event by double-clicking on the timer-icon below you the VS-designer. In this tick-event start your process.

      M 1 Reply Last reply
      0
      • M member27

        Hi I want to open a note pad for every 2 seconds by setting a timer control.. can anyone can help?? Dim t As New Timer t.Interval = 500 t.Start() process.Start("notepad.exe") I didnt complete the code any one can help? I dont know how to put loop for opening a note pad for each 2 second

        A Offline
        A Offline
        Ashfield
        wrote on last edited by
        #3

        You put your code in the timer tick event, but are you REALLY sure you want to open notepad every 2 seconds? You will soon be overloaded with them.

        Bob Ashfield Consultants Ltd

        1 Reply Last reply
        0
        • M member27

          Hi I want to open a note pad for every 2 seconds by setting a timer control.. can anyone can help?? Dim t As New Timer t.Interval = 500 t.Start() process.Start("notepad.exe") I didnt complete the code any one can help? I dont know how to put loop for opening a note pad for each 2 second

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          If you manage to get this working, your affection for NotePad will soon be over... :laugh:

          Luc Pattyn [Forum Guidelines] [My Articles]


          Fixturized forever. :confused:


          1 Reply Last reply
          0
          • S Smithers Jones

            Drag the timer-icon from the toolbox onto your form. Set its interval = 2000 (milliseconds). Create the timer-tick-event by double-clicking on the timer-icon below you the VS-designer. In this tick-event start your process.

            M Offline
            M Offline
            member27
            wrote on last edited by
            #5

            Thank u for your reply .I have sent my code .In the textbox if i give "0:0:10" aftre 10 seconds over the note pad will open.. hgow to open the note pad in every 2 seconds .? In the form load ::: TextBox1.Text = "0:0:2" '"2:07:59" Timer_tick:: Dim timspan As TimeSpan = dt - Now If timspan.Ticks < 0 Then Timer1.Enabled = False Label1.Text = "Test completed" Button2.Enabled = True Dim blah As Process blah = New Process() Process.Start("notepad.exe") End If In the button click event :: dt = Now + TimeSpan.Parse(TextBox1.Text) Timer1.Enabled = True Timer = New Timers.Timer() 'initialise internal timer _StartTime = Date.Now _CurrentTime = _StartTime SetTargetTime(1) Start()

            A 1 Reply Last reply
            0
            • M member27

              Thank u for your reply .I have sent my code .In the textbox if i give "0:0:10" aftre 10 seconds over the note pad will open.. hgow to open the note pad in every 2 seconds .? In the form load ::: TextBox1.Text = "0:0:2" '"2:07:59" Timer_tick:: Dim timspan As TimeSpan = dt - Now If timspan.Ticks < 0 Then Timer1.Enabled = False Label1.Text = "Test completed" Button2.Enabled = True Dim blah As Process blah = New Process() Process.Start("notepad.exe") End If In the button click event :: dt = Now + TimeSpan.Parse(TextBox1.Text) Timer1.Enabled = True Timer = New Timers.Timer() 'initialise internal timer _StartTime = Date.Now _CurrentTime = _StartTime SetTargetTime(1) Start()

              A Offline
              A Offline
              Ashfield
              wrote on last edited by
              #6

              Instead of keep asking, whu not read up on the system timer - you have been given the answer bu 2 people already. If you drag a timer from the toolbox onto your form, then double click the timer it will open the timer_click event coce. Now find out the rest by doing a bit of work for yourself.

              Bob Ashfield Consultants Ltd

              M 1 Reply Last reply
              0
              • A Ashfield

                Instead of keep asking, whu not read up on the system timer - you have been given the answer bu 2 people already. If you drag a timer from the toolbox onto your form, then double click the timer it will open the timer_click event coce. Now find out the rest by doing a bit of work for yourself.

                Bob Ashfield Consultants Ltd

                M Offline
                M Offline
                member27
                wrote on last edited by
                #7

                [Message Deleted]

                D A 2 Replies Last reply
                0
                • M member27

                  [Message Deleted]

                  D Offline
                  D Offline
                  Dave Kreskowiak
                  wrote on last edited by
                  #8

                  cbenan wrote:

                  wat is this?U cant answer properly ..we r trying this..if u cant help no need to reply...

                  And what happens if you can't understand, or refuse to try, the simple answers you've been given?? Those answers are in the simplest terms possible. What do you want?? The code written for you?? What would learn then??

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                       2006, 2007, 2008

                  1 Reply Last reply
                  0
                  • M member27

                    [Message Deleted]

                    A Offline
                    A Offline
                    Ashfield
                    wrote on last edited by
                    #9

                    I did help, I have given you simple instructions to achieve what you are asking for, as has at least one other poster. What more can I do? Write the code for you? Tough.

                    Bob Ashfield Consultants Ltd

                    M 1 Reply Last reply
                    0
                    • A Ashfield

                      I did help, I have given you simple instructions to achieve what you are asking for, as has at least one other poster. What more can I do? Write the code for you? Tough.

                      Bob Ashfield Consultants Ltd

                      M Offline
                      M Offline
                      member27
                      wrote on last edited by
                      #10

                      ok thanx

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups