Click here to Skip to main content
15,903,540 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Thread manager Pin
svanwass12-Nov-10 10:23
svanwass12-Nov-10 10:23 
GeneralRe: Thread manager Pin
Jason Christian17-Nov-10 6:06
Jason Christian17-Nov-10 6:06 
AnswerRe: Question on threading Pin
Luc Pattyn12-Nov-10 10:23
sitebuilderLuc Pattyn12-Nov-10 10:23 
GeneralRe: Question on threading Pin
svanwass16-Nov-10 6:30
svanwass16-Nov-10 6:30 
AnswerRe: Question on threading Pin
Luc Pattyn16-Nov-10 7:08
sitebuilderLuc Pattyn16-Nov-10 7:08 
GeneralRe: Question on threading Pin
svanwass16-Nov-10 9:24
svanwass16-Nov-10 9:24 
GeneralRe: Question on threading Pin
Luc Pattyn16-Nov-10 9:41
sitebuilderLuc Pattyn16-Nov-10 9:41 
GeneralRe: Question on threading Pin
svanwass16-Nov-10 9:50
svanwass16-Nov-10 9:50 
My apologies.

Main Form

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim passing(0, 3) As String
        passing(0, 0) = "10.1.1.1"
        passing(0, 1) = "10.1.1.2"
        passing(0, 2) = "10.1.1.3"
        passing(0, 3) = "10.1.1.4"
        Dim myworker As New Foo(passing)
    End Sub

   Private Sub IHeardThat() Handles Foo.IamDone
          'this does NOT work
    End Sub
End Class


My Foo class
Imports System.ComponentModel
Imports System.IO
Imports System.Threading
Public Class Foo

    Public WithEvents backgroundWorker1 As System.ComponentModel.BackgroundWorker
    Public Event IamDone(ByVal sender As Object, ByVal IP As String)

    Dim devicelist(,) As String
    Dim txtFile
    Public Sub New(ByVal Value As String(,))
        devicelist = Value
        backgroundWorker1 = New BackgroundWorker

        backgroundWorker1.WorkerReportsProgress = True
        backgroundWorker1.RunWorkerAsync(devicelist)
    End Sub
    Private Sub backgroundWorker1_DoWork(ByVal sender As Object, ByVal e As DoWorkEventArgs) Handles backgroundWorker1.DoWork

        ' Get the BackgroundWorker object that raised this event.
        Dim worker As BackgroundWorker = CType(sender, BackgroundWorker)
        Dim myargs As String(,) = e.Argument

    End Sub
    Private Sub backgroundWorker1_RunWorkerCompleted(ByVal sender As Object, ByVal e As RunWorkerCompletedEventArgs) Handles backgroundWorker1.RunWorkerCompleted

            RaiseEvent IamDone(Me, "Done")
        End If
    End Sub 
   
End Class


So that's basically it. I attempted to write a sub that would handle the custom event but the form class doesnt see the foo class event.

Does that make sense?
GeneralRe: Question on threading Pin
Luc Pattyn16-Nov-10 11:29
sitebuilderLuc Pattyn16-Nov-10 11:29 
AnswerRe: Question on threading Pin
Tieske817-Nov-10 1:43
professionalTieske817-Nov-10 1:43 
AnswerRe: Question on threading Pin
Spectre_00117-Nov-10 2:38
Spectre_00117-Nov-10 2:38 
GeneralRe: Question on threading Pin
svanwass17-Nov-10 4:52
svanwass17-Nov-10 4:52 
GeneralRe: Question on threading Pin
Spectre_00117-Nov-10 4:56
Spectre_00117-Nov-10 4:56 
AnswerRe: Question on threading [modified] Pin
SLDWorks17-Nov-10 18:59
SLDWorks17-Nov-10 18:59 
QuestionHow to populate a listbox from one listbox? Pin
waner michaud12-Nov-10 6:59
waner michaud12-Nov-10 6:59 
AnswerRe: How to populate a listbox from one listbox? Pin
Dr.Walt Fair, PE12-Nov-10 9:58
professionalDr.Walt Fair, PE12-Nov-10 9:58 
AnswerRe: How to populate a listbox from one listbox? Pin
Tarun.K.S15-Nov-10 19:28
Tarun.K.S15-Nov-10 19:28 
QuestionMulti-project solution with common DLLs Pin
vvincent12-Nov-10 5:17
vvincent12-Nov-10 5:17 
AnswerRe: Multi-project solution with common DLLs Pin
Dave Kreskowiak12-Nov-10 6:16
mveDave Kreskowiak12-Nov-10 6:16 
GeneralRe: Multi-project solution with common DLLs Pin
vvincent12-Nov-10 8:54
vvincent12-Nov-10 8:54 
GeneralRe: Multi-project solution with common DLLs Pin
Dave Kreskowiak12-Nov-10 10:14
mveDave Kreskowiak12-Nov-10 10:14 
GeneralRe: Multi-project solution with common DLLs Pin
vvincent12-Nov-10 11:27
vvincent12-Nov-10 11:27 
AnswerRe: Multi-project solution with common DLLs Pin
_Erik_12-Nov-10 6:38
_Erik_12-Nov-10 6:38 
QuestionStrangest problem with interop on Win7 client and .ocx control Pin
Jon_Boy12-Nov-10 3:38
Jon_Boy12-Nov-10 3:38 
AnswerRe: Strangest problem with interop on Win7 client and .ocx control Pin
Jon_Boy15-Nov-10 4:19
Jon_Boy15-Nov-10 4:19 

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.