Click here to Skip to main content
15,924,039 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How can I detect child form close action in VB.NET 2005 Pin
Dave Kreskowiak30-Jun-10 9:31
mveDave Kreskowiak30-Jun-10 9:31 
GeneralRe: How can I detect child form close action in VB.NET 2005 Pin
Andraw Tang30-Jun-10 9:40
Andraw Tang30-Jun-10 9:40 
GeneralRe: How can I detect child form close action in VB.NET 2005 Pin
Dave Kreskowiak30-Jun-10 12:39
mveDave Kreskowiak30-Jun-10 12:39 
GeneralRe: How can I detect child form close action in VB.NET 2005 Pin
Andraw Tang1-Jul-10 3:32
Andraw Tang1-Jul-10 3:32 
GeneralRe: How can I detect child form close action in VB.NET 2005 Pin
Dave Kreskowiak1-Jul-10 3:42
mveDave Kreskowiak1-Jul-10 3:42 
GeneralRe: How can I detect child form close action in VB.NET 2005 Pin
Andraw Tang1-Jul-10 3:59
Andraw Tang1-Jul-10 3:59 
GeneralRe: How can I detect child form close action in VB.NET 2005 Pin
Andraw Tang1-Jul-10 4:03
Andraw Tang1-Jul-10 4:03 
AnswerRe: How can I detect child form close action in VB.NET 2005 Pin
William Winner30-Jun-10 9:38
William Winner30-Jun-10 9:38 
First, are you just showing the child form in the tree node click event?

Because if you set it to nothing and then call frmChild1.Show() you'll get a null reference error.

You really shouldn't initialize the forms when the form is loaded, but do it when the tree node is clicked.

Then, when you create the child node, you need to hook the form closed event.

Personally, I wouldn't define the children forms to begin with, but would use a Dictionary to store them as you create them.

But, the code would look like:

VB
frmChild1 = New frmChildForm1
AddHandler frmChild1.FormClosed, AddressOf ChildFormClosed

'more code
End Sub

Private Sub ChildFormClosed(ByVal sender as System.Object, ByVal e as System.Windows.Forms.FormClosedEventArgs)
    CType(sender, Form).Dispose
    
    If TypeOf sender Is frmChildForm1 Then
        frmChild1 = Nothing
    End If
End Sub


Again, that's not the way I would do it, but that's the way it looks like you want to.
GeneralRe: How can I detect child form close action in VB.NET 2005 Pin
Andraw Tang30-Jun-10 10:11
Andraw Tang30-Jun-10 10:11 
AnswerRe: How can I detect child form close action in VB.NET 2005 [modified] Pin
Аslam Iqbal13-Jul-10 5:55
professionalАslam Iqbal13-Jul-10 5:55 
QuestionCommunication via Serial Port on PPC Pin
Dominick Marciano29-Jun-10 15:13
professionalDominick Marciano29-Jun-10 15:13 
AnswerRe: Communication via Serial Port on PPC Pin
tiggerc1-Jul-10 5:04
tiggerc1-Jul-10 5:04 
GeneralRe: Communication via Serial Port on PPC Pin
Dominick Marciano1-Jul-10 13:11
professionalDominick Marciano1-Jul-10 13:11 
GeneralRe: Communication via Serial Port on PPC Pin
tiggerc2-Jul-10 3:57
tiggerc2-Jul-10 3:57 
QuestionHow can I trace an AddIn's startup error? Pin
Sonhospa29-Jun-10 13:01
Sonhospa29-Jun-10 13:01 
AnswerRe: How can I trace an AddIn's startup error? Pin
Luc Pattyn29-Jun-10 13:15
sitebuilderLuc Pattyn29-Jun-10 13:15 
NewsRe: How can I trace an AddIn's startup error? Pin
Sonhospa30-Jun-10 0:01
Sonhospa30-Jun-10 0:01 
GeneralRe: How can I trace an AddIn's startup error? Pin
Dave Kreskowiak30-Jun-10 1:35
mveDave Kreskowiak30-Jun-10 1:35 
GeneralRe: How can I trace an AddIn's startup error? Pin
Sonhospa30-Jun-10 3:07
Sonhospa30-Jun-10 3:07 
GeneralRe: How can I trace an AddIn's startup error? Pin
Dave Kreskowiak30-Jun-10 3:27
mveDave Kreskowiak30-Jun-10 3:27 
GeneralRe: How can I trace an AddIn's startup error? Pin
Sonhospa30-Jun-10 6:26
Sonhospa30-Jun-10 6:26 
GeneralRe: How can I trace an AddIn's startup error? Pin
Luc Pattyn30-Jun-10 7:03
sitebuilderLuc Pattyn30-Jun-10 7:03 
GeneralRe: How can I trace an AddIn's startup error? Pin
Dave Kreskowiak30-Jun-10 7:13
mveDave Kreskowiak30-Jun-10 7:13 
QuestionDatagridview and Bindingsource Pin
Nielvh29-Jun-10 1:48
Nielvh29-Jun-10 1:48 
AnswerRe: Datagridview and Bindingsource Pin
DaveAuld29-Jun-10 2:05
professionalDaveAuld29-Jun-10 2:05 

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.