Click here to Skip to main content
15,899,935 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionMySQL in VB Pin
Dalek Dave27-Apr-09 10:14
professionalDalek Dave27-Apr-09 10:14 
AnswerRe: MySQL in VB Pin
Steven J Jowett27-Apr-09 10:36
Steven J Jowett27-Apr-09 10:36 
AnswerRe: MySQL in VB Pin
David Mujica27-Apr-09 10:37
David Mujica27-Apr-09 10:37 
QuestionHow do you select text or data in a form? Pin
AndyASPVB27-Apr-09 9:35
AndyASPVB27-Apr-09 9:35 
AnswerRe: How do you select text or data in a form? Pin
Christian Graus27-Apr-09 9:52
protectorChristian Graus27-Apr-09 9:52 
AnswerRe: How do you select text or data in a form? Pin
Dave Kreskowiak27-Apr-09 11:14
mveDave Kreskowiak27-Apr-09 11:14 
QuestionRaising Events from a class library Pin
xbiplav27-Apr-09 9:12
xbiplav27-Apr-09 9:12 
AnswerRe: Raising Events from a class library [modified] Pin
Dave Kreskowiak27-Apr-09 11:13
mveDave Kreskowiak27-Apr-09 11:13 
There's no magical difference between events in a Form and events in a class library. A Form is just another class.

The code snippet you've posted is correct. You just have to keep going and flesh it out with an Event Args class of your own making and add some code that raises the event.
Public Class SomeClass
 
    Public Event WorkCompleted(ByVal e As WorkCompletedEventArgs)
 
    ...
        RaiseEvent WorkCompleted(New WorkCompletedEventArgs(someValue, someOtherValue))
    ...
End Class
 
Public Class WorkCompletedEventArgs
    ' Expose Public properties that will
    ' return values to the subscriber.
    ' You might want to include a New (constructor)
    ' that set's these values instead of just
    ' relying on an empty constructor.

    Public Sub New(ByVal value1 As Integer, ByVal value2 As String)
        Me.myValue = value1
        Me.myString = value2
    End Sub
End Class



A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007, 2008




modified on Tuesday, April 28, 2009 12:38 AM

QuestionDisplaying image on form Pin
Jim Turner27-Apr-09 9:01
Jim Turner27-Apr-09 9:01 
AnswerRe: Displaying image on form Pin
0x3c027-Apr-09 9:32
0x3c027-Apr-09 9:32 
Question[Message Deleted] Pin
bam37227-Apr-09 8:30
bam37227-Apr-09 8:30 
AnswerRe: Visual Basic Pin
Christian Graus27-Apr-09 9:53
protectorChristian Graus27-Apr-09 9:53 
Answerfloating point and Integer Math Pin
David Mujica27-Apr-09 10:56
David Mujica27-Apr-09 10:56 
QuestionOpenfileDialogBox file type change event handler Pin
meaningless27-Apr-09 3:08
meaningless27-Apr-09 3:08 
AnswerRe: OpenfileDialogBox file type change event handler Pin
Tom Deketelaere27-Apr-09 5:03
professionalTom Deketelaere27-Apr-09 5:03 
QuestionRefresh SQL 2000 (VB.NET) Pin
hoangsamac26-Apr-09 23:15
hoangsamac26-Apr-09 23:15 
AnswerRe: Refresh SQL 2000 (VB.NET) Pin
Christian Graus26-Apr-09 23:22
protectorChristian Graus26-Apr-09 23:22 
GeneralRe: Refresh SQL 2000 (VB.NET) Pin
hoangsamac26-Apr-09 23:30
hoangsamac26-Apr-09 23:30 
GeneralRe: Refresh SQL 2000 (VB.NET) Pin
Christian Graus26-Apr-09 23:52
protectorChristian Graus26-Apr-09 23:52 
GeneralRe: Refresh SQL 2000 (VB.NET) Pin
Jon_Boy27-Apr-09 3:21
Jon_Boy27-Apr-09 3:21 
GeneralRe: Refresh SQL 2000 (VB.NET) Pin
Christian Graus27-Apr-09 9:54
protectorChristian Graus27-Apr-09 9:54 
Questionaccess databse into datagridview Pin
rajulama26-Apr-09 22:30
rajulama26-Apr-09 22:30 
AnswerRe: access databse into datagridview Pin
Christian Graus26-Apr-09 22:45
protectorChristian Graus26-Apr-09 22:45 
GeneralRe: access databse into datagridview Pin
rajulama26-Apr-09 22:54
rajulama26-Apr-09 22:54 
GeneralRe: access databse into datagridview Pin
Christian Graus26-Apr-09 22:59
protectorChristian Graus26-Apr-09 22:59 

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.