StrataFrame Forum
Back
Login
Login
Home
»
StrataFrame Application Framework - V1
»
WinForms (How do I?)
»
Creating an Instance of a Form From a String
Creating an Instance of a Form From a String
Post Reply
Like
0
Creating an Instance of a Form From a String
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Bill Cunnien
Bill Cunnien
posted 15 Years Ago
ANSWER
HOT
Topic Details
Share Topic
Group: Forum Members
Posts: 785,
Visits: 3.6K
This is turning out to be a little more difficult than I expected. I used the
forum entry
to guide me but I have run into a problem with the following code:
((Form)Activator.CreateInstance(mFormName, "Form")).Show();
The error that I get when I build the project is:
Cannot convert type 'System.Runtime.Remoting.ObjectHandle' to 'System.Windows.Forms.Form'
I have tried simply passing the string of the form ("MyNamespace.MyForm") to CreateInstance, but that does not work, either.
Any direction that you can provide would be helpful.
Bill
Reply
Like
0
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Threaded View
Threaded View
Creating an Instance of a Form From a String
Bill Cunnien
-
15 Years Ago
By the way, if I change the code to this:
...
Bill Cunnien
-
15 Years Ago
Hi Bill,
I hard code the full form name on a property of the menu...
Edhy Rijo
-
15 Years Ago
If you are going to create it off of a string, you have to pass the...
Trent L. Taylor
-
15 Years Ago
Yup...I did that and the response was the same string that I used in...
Bill Cunnien
-
15 Years Ago
You may need to also include the assembly name and version as well if...
Trent L. Taylor
-
15 Years Ago
The code I was using yesterday was the following:
...
Bill Cunnien
-
15 Years Ago
Yup...one thing you can try also is to leave out the version in that...
Trent L. Taylor
-
15 Years Ago
[quote]...one thing you can try also is to leave out the version in...
Bill Cunnien
-
15 Years Ago
Hi Bill,
Glad to be able to help. I also borrowed some idea from...
Edhy Rijo
-
15 Years Ago
I place the AssemblyQualifiedName into the tag of the NavBarItem, then...
Bill Cunnien
-
15 Years Ago
[quote][b]Bill Cunnien (04/15/2009)[/b][hr]Edhy, I do need to review...
Edhy Rijo
-
15 Years Ago
Post Reply
Like
0
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search