Click here to Skip to main content
15,117,095 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: C# to VB Adaption Problem Pin
Eddy Vluggen2-Jan-12 7:34
professionalEddy Vluggen2-Jan-12 7:34 
GeneralRe: C# to VB Adaption Problem Pin
Terence Wallace3-Jan-12 8:32
MemberTerence Wallace3-Jan-12 8:32 
AnswerRe: C# to VB Adaption Problem with Lambda Expressions Pin
Simon_Whale2-Jan-12 13:33
professionalSimon_Whale2-Jan-12 13:33 
GeneralRe: C# to VB Adaption Problem with Lambda Expressions Pin
Sonhospa10-Jan-12 0:09
MemberSonhospa10-Jan-12 0:09 
GeneralRe: C# to VB Adaption Problem with Lambda Expressions Pin
Simon_Whale10-Jan-12 0:12
professionalSimon_Whale10-Jan-12 0:12 
AnswerRe: C# to VB Adaption Problem with Lambda Expressions Pin
Member 78595873-Jan-12 3:58
MemberMember 78595873-Jan-12 3:58 
GeneralRe: C# to VB Adaption Problem with Lambda Expressions Pin
Sonhospa10-Jan-12 0:15
MemberSonhospa10-Jan-12 0:15 
AnswerRe: C# to VB Adaption Problem with Lambda Expressions Pin
Estys3-Jan-12 5:03
MemberEstys3-Jan-12 5:03 
I always have trouble with anonymous delegates in VB so I factored them out :
VB
Class Program
    Shared worker As BackgroundWorker
    Public Shared Sub Main() 'ByVal args As String())
        worker = New BackgroundWorker()
        worker.WorkerReportsProgress = True
        AddHandler worker.DoWork, AddressOf DoWork
        AddHandler worker.ProgressChanged, AddressOf ProgressChanged
        worker.RunWorkerAsync()
        Console.Read()
    End Sub

    Private Shared Sub DoWork(ByVal sender As Object, ByVal e As DoWorkEventArgs)
        Dim items = Enumerable.Range(1, 1000)
        items.WithProgressReporting(AddressOf ReportProgress).ForEach(AddressOf DoSleep)
    End Sub
    Private Shared Sub ReportProgress(ByVal progress As Integer)
        worker.ReportProgress(progress)
    End Sub
    Private Shared Sub DoSleep(ByVal item As Integer)
        Thread.Sleep(10)
    End Sub
    Private Shared Sub ProgressChanged(ByVal sender As Object, ByVal e As ProgressChangedEventArgs)
        Console.SetCursorPosition(1, 0)
        Console.Write(e.ProgressPercentage)
    End Sub
End Class


Cheers
GeneralRe: C# to VB Adaption Problem with Lambda Expressions Pin
Sonhospa10-Jan-12 0:19
MemberSonhospa10-Jan-12 0:19 
GeneralRe: C# to VB Adaption Problem with Lambda Expressions Pin
Estys10-Jan-12 0:50
MemberEstys10-Jan-12 0:50 
AnswerRe: C# to VB Adaption Problem with Lambda Expressions Pin
DavidSherwood3-Jan-12 17:56
MemberDavidSherwood3-Jan-12 17:56 
GeneralRe: C# to VB Adaption Problem with Lambda Expressions Pin
Simon_Whale3-Jan-12 22:51
professionalSimon_Whale3-Jan-12 22:51 
GeneralRe: C# to VB Adaption Problem with Lambda Expressions Pin
Sonhospa10-Jan-12 0:22
MemberSonhospa10-Jan-12 0:22 
QuestionHow to add Excise in forms of my project is Inventnagemegment system ory Ma Pin
kathiriya31-Dec-11 20:16
Memberkathiriya31-Dec-11 20:16 
QuestionHow to add Excise in forms of my project is Inventnagemant ory Ma Pin
kathiriya31-Dec-11 20:13
Memberkathiriya31-Dec-11 20:13 
QuestionUpdate BrowserFlags and EditFlags value in Window7 registry Pin
Nitin Varshneya29-Dec-11 4:44
MemberNitin Varshneya29-Dec-11 4:44 
AnswerRe: Update BrowserFlags and EditFlags value in Window7 registry Pin
Dave Kreskowiak29-Dec-11 5:08
mveDave Kreskowiak29-Dec-11 5:08 
GeneralRe: Update BrowserFlags and EditFlags value in Window7 registry Pin
Nitin Varshneya29-Dec-11 5:14
MemberNitin Varshneya29-Dec-11 5:14 
GeneralRe: Update BrowserFlags and EditFlags value in Window7 registry Pin
Dave Kreskowiak29-Dec-11 6:00
mveDave Kreskowiak29-Dec-11 6:00 
AnswerRe: Update BrowserFlags and EditFlags value in Window7 registry Pin
Luc Pattyn29-Dec-11 6:41
sitebuilderLuc Pattyn29-Dec-11 6:41 
GeneralRe: Update BrowserFlags and EditFlags value in Window7 registry Pin
Dave Kreskowiak29-Dec-11 7:57
mveDave Kreskowiak29-Dec-11 7:57 
GeneralRe: Update BrowserFlags and EditFlags value in Window7 registry Pin
Nitin Varshneya30-Dec-11 3:23
MemberNitin Varshneya30-Dec-11 3:23 
GeneralRe: Update BrowserFlags and EditFlags value in Window7 registry Pin
Dave Kreskowiak30-Dec-11 10:10
mveDave Kreskowiak30-Dec-11 10:10 
GeneralRe: Update BrowserFlags and EditFlags value in Window7 registry Pin
Nitin Varshneya3-Jan-12 1:51
MemberNitin Varshneya3-Jan-12 1:51 
GeneralRe: Update BrowserFlags and EditFlags value in Window7 registry Pin
Dave Kreskowiak3-Jan-12 10:36
mveDave Kreskowiak3-Jan-12 10:36 

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.