I'm trying to do this:
Expand|Select|Wrap|Line Numbers
- Dim MyForm As New Object
- or
- Dim MyForm As System.Windows.Forms.Form
- Select Case Form.Activeform.Name
- Case My.Forms.Form1.Name
- MyForm = My.Forms.Form1
- Case My Forms.Form2.Name
- MyForm = My.Forms.Form2
- End Select
So I need to convert MyForm Type whether into Form1 or Form2, in order to be access to properties and methods of one of those class.
I tried with Ctype, DirectCast, TryCast, Convert.ChangeType... etc., and MyForm always keep its Object or Form Type.
Doing a unboxing neither works to me. For instance:
CType(MyForm, Form2).property.xxxx.focus()
That works but not to what I really need. I want to convert MyForm or whatever it was into a Form1 or Fomr2 Class.
Thanks.