Click here to Skip to main content
16,007,163 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionDesign Problem... Pin
Johndas3-Dec-08 21:13
Johndas3-Dec-08 21:13 
AnswerRe: Design Problem... Pin
Jay Royall3-Dec-08 21:35
Jay Royall3-Dec-08 21:35 
AnswerRe: Design Problem... Pin
Nanda_MR3-Dec-08 22:11
Nanda_MR3-Dec-08 22:11 
QuestionAdding an event (C# code in VB) Pin
MatthysDT3-Dec-08 20:34
MatthysDT3-Dec-08 20:34 
AnswerRe: Adding an event (C# code in VB) Pin
Tom Deketelaere3-Dec-08 22:36
professionalTom Deketelaere3-Dec-08 22:36 
GeneralRe: Adding an event (C# code in VB) Pin
MatthysDT4-Dec-08 2:10
MatthysDT4-Dec-08 2:10 
GeneralRe: Adding an event (C# code in VB) Pin
Tom Deketelaere4-Dec-08 2:20
professionalTom Deketelaere4-Dec-08 2:20 
GeneralRe: Adding an event (C# code in VB) [modified] Pin
MatthysDT4-Dec-08 19:56
MatthysDT4-Dec-08 19:56 
Here is what I have so far, I get a NullReferenceException on the AddHandler line.

This is not the same code as the DirtyMarker, but it comes down to the same implementation. This code is supposed to do something when the main form's Datagridview fires userDeletingRow.

Also please ignore the fact that this is a generic type class, I'll focus on that when I get these events to work.

Public Class DataFormLogic(Of T)

    Public Sub New(ByRef DGV As DataGridView)

        AddHandler DGV.UserDeletingRow, AddressOf MyDelete

        'Also tried this, which give a delegate signature error at compile time
        'AddHandler DGV.UserDeletingRow, New EventHandler(AddressOf MyDelete)

    End Sub
    
Private Sub MyDelete(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewRowCancelEventArgs)
        MsgBox("Eureka!!!!!")
    End Sub
End Class


-----------------------------------
UPDATE:

I just got it to work with a button on that same form, it must have something to do with the DataGridView... oh how I loathe that control! Could you try to get it going with a datagridview?


modified on Friday, December 5, 2008 3:32 AM

GeneralRe: Adding an event (C# code in VB) Pin
Tom Deketelaere4-Dec-08 20:54
professionalTom Deketelaere4-Dec-08 20:54 
GeneralRe: Adding an event (C# code in VB) Pin
MatthysDT4-Dec-08 21:36
MatthysDT4-Dec-08 21:36 
GeneralRe: Adding an event (C# code in VB) Pin
Tom Deketelaere4-Dec-08 21:40
professionalTom Deketelaere4-Dec-08 21:40 
AnswerRe: Adding an event (C# code in VB) Pin
Gideon Engelberth4-Dec-08 3:01
Gideon Engelberth4-Dec-08 3:01 
AnswerRe: Adding an event (C# code in VB) Pin
Dave Doknjas4-Dec-08 13:52
Dave Doknjas4-Dec-08 13:52 
QuestionSerial Port in the toolbox Pin
Subjugate3-Dec-08 19:39
Subjugate3-Dec-08 19:39 
AnswerRe: Serial Port in the toolbox Pin
SelvaShankar3-Dec-08 20:07
SelvaShankar3-Dec-08 20:07 
Questiongetting file name Pin
jishbalan3-Dec-08 18:54
jishbalan3-Dec-08 18:54 
AnswerRe: getting file name Pin
Christian Graus3-Dec-08 19:00
protectorChristian Graus3-Dec-08 19:00 
Questioninsert multiple listbox text to database. Pin
sumit52833-Dec-08 18:47
sumit52833-Dec-08 18:47 
AnswerRe: insert multiple listbox text to database. Pin
Christian Graus3-Dec-08 18:59
protectorChristian Graus3-Dec-08 18:59 
GeneralRe: insert multiple listbox text to database. Pin
sumit52833-Dec-08 19:14
sumit52833-Dec-08 19:14 
GeneralRe: insert multiple listbox text to database. Pin
Mycroft Holmes3-Dec-08 19:41
professionalMycroft Holmes3-Dec-08 19:41 
GeneralRe: insert multiple listbox text to database. Pin
Paul Conrad4-Dec-08 5:02
professionalPaul Conrad4-Dec-08 5:02 
GeneralRe: insert multiple listbox text to database. Pin
sumit52834-Dec-08 17:31
sumit52834-Dec-08 17:31 
QuestionLotto Program Challenge..how would you create this program? Pin
creelo3-Dec-08 17:36
creelo3-Dec-08 17:36 
AnswerRe: Lotto Program Challenge..how would you create this program? Pin
Christian Graus3-Dec-08 18:17
protectorChristian Graus3-Dec-08 18:17 

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.