M
MikeB
Hi, I'd appreciate some help, please. I'm writing a VS2005 VB project
for school and one of the requirements is that every screen should have
a "Help" button.
I could do it by writing a clumsy case statement like this:
sub showHelp(byval frm as String)
Select Case (frm)
Case "Form1"
dim help as new Form1
help.Show()
Case "Form2"
Dim help as new Form2
help.Show()
.... etc
I searched and found Activator. I think this will make for better code.
So I wrote:
Sub ShowHelp(ByVal strFrom As String)
Dim frmhelp = Activator.CreateInstance(Nothing, strFrom)
frmhelp.show()
End Sub
but now I'm getting a TypeLoadException that says:
Could not load type 'hlpForm1' from assembly 'TestHelp,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
The form I'm testing from is Form1 and I do have a form hlpForm1
defined. They are in the same Namespace and in the same assembly in the
same project.
I'm lost. Can someone please help and tell me what I'm doing wrong?
Thanks.
for school and one of the requirements is that every screen should have
a "Help" button.
I could do it by writing a clumsy case statement like this:
sub showHelp(byval frm as String)
Select Case (frm)
Case "Form1"
dim help as new Form1
help.Show()
Case "Form2"
Dim help as new Form2
help.Show()
.... etc
I searched and found Activator. I think this will make for better code.
So I wrote:
Sub ShowHelp(ByVal strFrom As String)
Dim frmhelp = Activator.CreateInstance(Nothing, strFrom)
frmhelp.show()
End Sub
but now I'm getting a TypeLoadException that says:
Could not load type 'hlpForm1' from assembly 'TestHelp,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
The form I'm testing from is Form1 and I do have a form hlpForm1
defined. They are in the same Namespace and in the same assembly in the
same project.
I'm lost. Can someone please help and tell me what I'm doing wrong?
Thanks.