D
Don
I think "macro substitution" is the correct term for what I want to do, but,
to be sure, here is a description of what I'd like to know is possible:
I want to be able to create a create an object of a type whose name is
stored in a constant. For example:
Const FORM_NAME_1 as String = "frmThisForm"
Const FORM_NAME_2 as String = "frmThatForm"
Dim frmTemp as Form
If condition then
frmTemp = CType(frmTemp, FORM_NAME_1)
frmTemp = New FORM_NAME_1
else
frmTemp = CType(frmTemp, FORM_NAME_2)
frmTemp = New FORM_NAME_2
end if
frmTemp.Show
etc....
In the pseudo code above, I want to somehow access the string stored in
FORM_NAME_1 and FORM_NAME_2 in the lines of code where I use CType and New.
Is it possible to even do this in VB.NET?
- Don
to be sure, here is a description of what I'd like to know is possible:
I want to be able to create a create an object of a type whose name is
stored in a constant. For example:
Const FORM_NAME_1 as String = "frmThisForm"
Const FORM_NAME_2 as String = "frmThatForm"
Dim frmTemp as Form
If condition then
frmTemp = CType(frmTemp, FORM_NAME_1)
frmTemp = New FORM_NAME_1
else
frmTemp = CType(frmTemp, FORM_NAME_2)
frmTemp = New FORM_NAME_2
end if
frmTemp.Show
etc....
In the pseudo code above, I want to somehow access the string stored in
FORM_NAME_1 and FORM_NAME_2 in the lines of code where I use CType and New.
Is it possible to even do this in VB.NET?
- Don