Results 1 to 15 of 15

Thread: [2005] How do you stop a Marquee from going?

Threaded View

  1. #10

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Posts
    250

    Re: [2005] How do you stop a Marquee from going?

    Below is my code. I need the app to run as long as listbox1 is being populated with data (i can't figure this part out).

    ThreadPool = button
    ProgressIndicator = progressbar
    Listbox1 = listbox

    Code:
    Imports System.Threading
    
    Public Class MainForm
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load, MyBase.Load, MyBase.Load, MyBase.Load
            ThreadID.Text &= CStr(Thread.CurrentThread.ManagedThreadId)
        End Sub
    
        Private Sub theLongRunningTask()
            Do While ListBox1.Items.Count < 50
                ProgressIndicator.Style = ProgressBarStyle.Marquee
                ListBox1.Items.Add("test")
            Loop
            ProgressIndicator.Style = ProgressBarStyle.Blocks
            ProgressIndicator.Value = 0
        End Sub
    
        Delegate Sub TaskDelegate()
    
        Private Sub ThreadPool_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ThreadPool.Click
            Dim td As New TaskDelegate(AddressOf theLongRunningTask)
            td.BeginInvoke(Nothing, Nothing)
        End Sub
    End Class
    Last edited by Giraffe Frenzy; Apr 20th, 2007 at 06:20 AM.

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