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
Prev
1
2
Jump To Page
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 16 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 785,
Visits: 3.6K
By the way, if I change the code to this:
(Activator.CreateInstance(Type.GetType("Aspire.Sales.CustomerInvoices")) as Form).Show();
I get the following error:
Value cannot be null.\rParameter name: type
Obviously, the Type.GetType() function is not returning any type. I have confirmed the string. And, I have used several variations. No dice.
I started working on this yesterday afternoon. I am stumped. I had hoped a good night's sleep would provide a better perspective, but, alas!, it has not.
Bill
Reply
Like
0
Bill Cunnien
Bill Cunnien
posted 16 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
Post Reply
Like
0
Prev
1
2
Jump To Page
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search