Hi !
Here's the code :
In a module :
Public AgendaVar() As AgendaType 'THIS IS FOR THE SPECIAL PROPERTIES OF EACH
Agenda.
Public Agendas() As New Agenda
Public Type AgendaType
Free As Boolean
End Type
Public Function FindFreeAgenda() As Integer
ArrayCount = UBound(Agendas)
For i = 1 To ArrayCount
If AgendaVar(i).Free Then
FindFreeAgenda = i
AgendaVar(i).Free = False
Exit Function
End If
Next
ReDim Preserve Agendas(ArrayCount + 1)
ReDim Preserve AgendaVar(ArrayCount + 1)
AgendaVar(ArrayCount + 1).Free = False
FindFreeAgenda = UBound(AgendaVar)
End Function
In a form to add a new Agenda :
fIndex = FindFreeAgenda()
Agendas(fIndex).Tag = fIndex
AgendaVar(fIndex).Free = False
When the Agenda Form is closing :
AgendaVar(Me.Tag).Free = True
And after than I could use like Agendas(fIndex).Caption (Which is now .Text
in VB.NET) to change the window title of each one etc.
I think that I would have to do this VIA a collection, but I am not quite
sure.
Thanks to look at my problem !
Jonathan
"Jonathan Boivin" <djon2003@hotmail.com> a écrit dans le message de
news:%23I80$9TtDHA.2388@TK2MSFTNGP12.phx.gbl...
[quoted text, click to view] > Hi !
>
> In VB6 I managed how to load multiple instances of the same form. (I built
> an agenda which I need to load multiple times)
>
> Unfortunately, I can't figure out how to get it working on VB.NET.
>
> Is there someone which could help ?
>
> Thanks
> Jo
>
>