|
-
May 27th, 2004, 12:48 AM
#1
Thread Starter
Fanatic Member
How to show / showdialog form thru a string
Dear All,
How to show / showdialog form thru a string,
eg:
Dim mForm as String = "Form1"
How to show it?
Regards
Winanjaya
-
May 27th, 2004, 09:19 AM
#2
like this ....
VB Code:
Dim mForm As String = "Form3"
Dim f As Form = DirectCast(GetType(Form).InvokeMember(mForm, Reflection.BindingFlags.CreateInstance, Nothing, Nothing, Nothing), Form)
f.Show()
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
May 28th, 2004, 11:47 AM
#3
Thread Starter
Fanatic Member
Hi.. it works but all of objects (textbox, label, checkbox .. etc) not shown .. why? ..
-
May 28th, 2004, 03:55 PM
#4
sorry i forgot to use the correct type , you should be using Type.GetType , not GetType. specifying the application name and a dot ( . ) and the form name as a string ( eg: Application1.Form1 )
eg:
VB Code:
'/// use Type.GetType(appName & mForm)
Dim appName As String = Application.ProductName & "."
Dim mForm As String = "Form3"
Dim f As Form = DirectCast(Type.GetType(appName & mForm).InvokeMember(mForm, Reflection.BindingFlags.CreateInstance, Nothing, Nothing, Nothing), Form)
f.Show()
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Nov 25th, 2004, 03:12 AM
#5
Scooooooore!
dynamic_sysop - Dude! thank you very much for that little piece of code. It is EXACTLY what I needed. I've been knocking myself out on how to do just that. Once I got my Application Name set right (I had a space in it originally) it worked perfectly.
Danke a million times over.
Tg
-
Nov 25th, 2004, 06:56 AM
#6
PowerPoster
Re: Scooooooore!
Originally posted by techgnome
dynamic_sysop - Dude! thank you very much for that little piece of code. It is EXACTLY what I needed. I've been knocking myself out on how to do just that. Once I got my Application Name set right (I had a space in it originally) it worked perfectly.
Danke a million times over.
Tg
Hi techgnome,
Could you please elaborate on "Once I got my Application Name set right "
Do I understand you to say that you can create an instance of a form from another application?
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|