"Michael Creager" <md*******@adelphia.net> schrieb:
I am using VB NET 2002. How can I programmatically create a new windows
form using the value of a string variable as the name of the new form?
Public FrmName As String = "MDIChildFrm1"
Public %FrmName% as new Form
You cannot change a variable's name at runtime.
If the type of the form is variable, take a look at the code below:
\\\
Imports System.Reflection
..
..
..
Dim frm As Form = _
DirectCast( _
Activator.CreateInstance( _
Type.GetType("MyApplication.SampleForm") _
), _
Form _
)
frm.Show()
///
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>