Click here to Skip to main content
15,910,787 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Can not set the name property of a timer at runtime - VB.NET Pin
Covean3-Feb-10 2:34
Covean3-Feb-10 2:34 
AnswerRe: Can not set the name property of a timer at runtime - VB.NET Pin
Luc Pattyn3-Feb-10 2:34
sitebuilderLuc Pattyn3-Feb-10 2:34 
AnswerRe: Can not set the name property of a timer at runtime - VB.NET Pin
DaveAuld3-Feb-10 2:36
professionalDaveAuld3-Feb-10 2:36 
AnswerRe: Can not set the name property of a timer at runtime - VB.NET Pin
dan!sh 3-Feb-10 2:42
professional dan!sh 3-Feb-10 2:42 
AnswerRe: Can not set the name property of a timer at runtime - VB.NET Pin
Wayne Gaylard3-Feb-10 3:03
professionalWayne Gaylard3-Feb-10 3:03 
AnswerRe: Can not set the name property of a timer at runtime - VB.NET Pin
Dave Kreskowiak3-Feb-10 3:29
mveDave Kreskowiak3-Feb-10 3:29 
GeneralRe: Can not set the name property of a timer at runtime - VB.NET Pin
castingflame3-Feb-10 7:01
castingflame3-Feb-10 7:01 
GeneralRe: Can not set the name property of a timer at runtime - VB.NET Pin
Paul Roseby3-Feb-10 10:25
Paul Roseby3-Feb-10 10:25 
Im not quite sure I understand why it is you needed alot of timers, as im sure there would be a better way to do it.

I would have thought that you could just use Threads.

Dim t As New Threading.Thread(AddressOf myThread)

    Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
        t.Start()
    End Sub

    Private Sub myThread()
        Do
            'Work to be done
            '....

            ' Waits 5 seconds before next iteration
            Threading.Thread.Sleep(New TimeSpan(0, 0, 5))
            'Or for miliseconds use this: Threading.Thread.Sleep(500)
        Loop
    End Sub


The myThread method will continue running until either you run a t.stop() from somewhere else in your code or you call an "Exit Loop" from within the Do Loop.

Please Note:
If you are updating controls on a form from a threaded function you will need to use a Delegate, I can send you an example if you cannot find one.

Also if you have a number of threads accessing the same resources you might need to use a Mutex to limit access violations.


Hope this helps.
GeneralRe: Can not set the name property of a timer at runtime - VB.NET Pin
Paul Roseby3-Feb-10 10:28
Paul Roseby3-Feb-10 10:28 
QuestionListView: How to link columnheader into subitem Pin
jtpaa2-Feb-10 23:44
jtpaa2-Feb-10 23:44 
AnswerRe: ListView: How to link columnheader into subitem Pin
DaveAuld3-Feb-10 0:41
professionalDaveAuld3-Feb-10 0:41 
AnswerRe: ListView: How to link columnheader into subitem Pin
DaveAuld3-Feb-10 1:06
professionalDaveAuld3-Feb-10 1:06 
GeneralRe: ListView: How to link columnheader into subitem Pin
jtpaa3-Feb-10 1:29
jtpaa3-Feb-10 1:29 
AnswerRe: ListView: How to link columnheader into subitem Pin
DaveAuld3-Feb-10 2:31
professionalDaveAuld3-Feb-10 2:31 
GeneralRe: ListView: How to link columnheader into subitem Pin
jtpaa3-Feb-10 2:54
jtpaa3-Feb-10 2:54 
GeneralRe: ListView: How to link columnheader into subitem Pin
DaveAuld3-Feb-10 3:00
professionalDaveAuld3-Feb-10 3:00 
GeneralRe: ListView: How to link columnheader into subitem Pin
JR2124-Feb-10 1:00
JR2124-Feb-10 1:00 
QuestionVB SendKeys -Done- Pin
εїзεїзεїз2-Feb-10 23:18
εїзεїзεїз2-Feb-10 23:18 
AnswerRe: VB SendKeys Pin
DaveAuld3-Feb-10 0:35
professionalDaveAuld3-Feb-10 0:35 
GeneralRe: VB SendKeys Pin
εїзεїзεїз3-Feb-10 1:07
εїзεїзεїз3-Feb-10 1:07 
GeneralRe: VB SendKeys Pin
DaveAuld3-Feb-10 1:23
professionalDaveAuld3-Feb-10 1:23 
AnswerRe: VB SendKeys Pin
Luc Pattyn3-Feb-10 1:57
sitebuilderLuc Pattyn3-Feb-10 1:57 
AnswerRe: VB SendKeys Pin
Anubhava Dimri3-Feb-10 18:31
Anubhava Dimri3-Feb-10 18:31 
QuestionWindows 7 registry error Pin
Gagan.202-Feb-10 22:16
Gagan.202-Feb-10 22:16 
AnswerRe: Windows 7 registry error Pin
Dave Kreskowiak3-Feb-10 2:06
mveDave Kreskowiak3-Feb-10 2:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.