Question I need a pointer to a pointer

aaaron

Well-known member
Joined
Jan 23, 2011
Messages
216
Programming Experience
10+
I have many forms that need a few things done to all of them (like close, mininize...).
I got the following idea for eliminating the few sets of many lines of code to a few For loops.

VB.NET:
 Dim MonMdiChlidren As New List(Of Form)

 Protected Overrides Sub OnLoad(e As EventArgs)
       'Where: gFrmToolCalculator As FormToolCalculator
        MonMdiChlidren.Add(gFrmToolCalculator)
        ...
 End Sub
 Private Sub CloseAllNonMdiChildWindows()
        For Each frm As Form In MonMdiChlidren
            If frm IsNot Nothing Then frm.Close()
        to Next
 End sub

Of course it doesn't work.
gFrmToolCalculator is nothing on OnLoad (it gets set much later)

I was ?thinking? the array element would always point to whatever gFrmToolCalculator referenced.

I think I need a pointer to a pointer which I don't think exists in VB.Net.

Is there something like this that does work?
 
Back
Top