I have file like this
Code:
System.Windows.Forms.Label
System.Windows.Forms.Button
System.Windows.Forms.TextBox
How to load each control directly from its type string without checking like this
Code:
Dim a() As String = IO.File.ReadAllLines("some_file")
For Each s In a
Select Case s
Case "System.Windows.Forms.Label"
Dim ctl As Label = New Label
Me.Controls.Add(ctl)
Case "System.Windows.Forms.TextBox"
Dim ctl As TextBox = New TextBox
Me.Controls.Add(ctl)
' A lot of case statement required
End Select
Next