I'm working in VB.NET 2005
To optimise a program, I tried to make a function that would instanciate a windows form based on what type it recieves in parameter
Ex :
I have a form that's called FrmForm1 ( as an example )
and theres a variable named Dlg ( as System.windows.forms.form )
my function is like that
Private sub ShowForm(ByRef FrmForm as System.Windows.Forms.Form)
dlg = Nothing
dlg = CType(dlg, FrmForm)
dlg = new FrmForm()
dlg.show()
end sub
It's hard to explain exactly what i want to do in a formum, and even harder to search for something as precise as this on the net with search tools, i hope that with this example you can understand what exactly i want to do and tell me if there's a way to do it, thanks ( btw, this code doesn't work )
To optimise a program, I tried to make a function that would instanciate a windows form based on what type it recieves in parameter
Ex :
I have a form that's called FrmForm1 ( as an example )
and theres a variable named Dlg ( as System.windows.forms.form )
my function is like that
Private sub ShowForm(ByRef FrmForm as System.Windows.Forms.Form)
dlg = Nothing
dlg = CType(dlg, FrmForm)
dlg = new FrmForm()
dlg.show()
end sub
It's hard to explain exactly what i want to do in a formum, and even harder to search for something as precise as this on the net with search tools, i hope that with this example you can understand what exactly i want to do and tell me if there's a way to do it, thanks ( btw, this code doesn't work )