By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,279 Members | 1,244 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,279 IT Pros & Developers. It's quick & easy.

Can I create windows form by using late binding?

P: n/a
Hi,

I have a database table field to store the form name, I want to create the
particular windows form by using the value that read from that DB field. For
examples, the table field has a value "ThisForm", then I want to create the
form with class name "ThisForm" (Suppose I have already defined the class
"ThisForm"). Can I do this by using late bindnig? Any source code for
reference? Thanks!

Steven.
Feb 8 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Steven,

You have a form and you want to give it from the database the name from this
field. And then?

This sounds for me as

me = dr("ThisForm")

http://msdn2.microsoft.com/system.wi...trol.name.aspx

Not that it does something or is usable in your program, however that is it.

Cor

"Steven" <a@a.com> schreef in bericht
news:Ov**************@TK2MSFTNGP12.phx.gbl...
Hi,

I have a database table field to store the form name, I want to create the
particular windows form by using the value that read from that DB field.
For examples, the table field has a value "ThisForm", then I want to
create the form with class name "ThisForm" (Suppose I have already defined
the class "ThisForm"). Can I do this by using late bindnig? Any source
code for reference? Thanks!

Steven.

Feb 8 '06 #2

P: n/a
oh, sorry. My problem is to create an instance of the form but not just
change the name of the form.

For examples, I defined 3 windows form in my VB code which have name
"Form1", "Form2" and "Form3". Which form I need to display in screen is
depended on the field in the database table. Can I do this by using late
binding? Coz I don't know which form I need to create before doing the
database query.

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uk**************@TK2MSFTNGP12.phx.gbl...
Steven,

You have a form and you want to give it from the database the name from
this field. And then?

This sounds for me as

me = dr("ThisForm")

http://msdn2.microsoft.com/system.wi...trol.name.aspx

Not that it does something or is usable in your program, however that is
it.

Cor

"Steven" <a@a.com> schreef in bericht
news:Ov**************@TK2MSFTNGP12.phx.gbl...
Hi,

I have a database table field to store the form name, I want to create
the particular windows form by using the value that read from that DB
field. For examples, the table field has a value "ThisForm", then I want
to create the form with class name "ThisForm" (Suppose I have already
defined the class "ThisForm"). Can I do this by using late bindnig? Any
source code for reference? Thanks!

Steven.


Feb 8 '06 #3

P: n/a
CMM
Activator.CreateInstance(Assembly.GetExecutingAsse mbly().GetType("name"))

Note:
1) "Assembly" is in the System.Reflection namespace.
2) "name" must to be qualified with the namespace of your application (by
default, in VB, it's the same as your project name): "MyAppName.Form1"

"Steven" <a@a.com> wrote in message
news:ep***************@TK2MSFTNGP11.phx.gbl...
oh, sorry. My problem is to create an instance of the form but not just
change the name of the form.

For examples, I defined 3 windows form in my VB code which have name
"Form1", "Form2" and "Form3". Which form I need to display in screen is
depended on the field in the database table. Can I do this by using late
binding? Coz I don't know which form I need to create before doing the
database query.

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uk**************@TK2MSFTNGP12.phx.gbl...
Steven,

You have a form and you want to give it from the database the name from
this field. And then?

This sounds for me as

me = dr("ThisForm")

http://msdn2.microsoft.com/system.wi...trol.name.aspx

Not that it does something or is usable in your program, however that is
it.

Cor

"Steven" <a@a.com> schreef in bericht
news:Ov**************@TK2MSFTNGP12.phx.gbl...
Hi,

I have a database table field to store the form name, I want to create
the particular windows form by using the value that read from that DB
field. For examples, the table field has a value "ThisForm", then I want
to create the form with class name "ThisForm" (Suppose I have already
defined the class "ThisForm"). Can I do this by using late bindnig? Any
source code for reference? Thanks!

Steven.



Feb 8 '06 #4

P: n/a
"Steven" <a@a.com> schrieb:
I have a database table field to store the form name, I want to create the
particular windows form by using the value that read from that DB field.
For examples, the table field has a value "ThisForm", then I want to
create the form with class name "ThisForm" (Suppose I have already defined
the class "ThisForm").


<URL:http://dotnet.mvps.org/dotnet/code/techniques/#ClassByName>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Feb 8 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.