|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Can I create windows form by using late binding?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. 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.windows.forms.control.name.aspx Not that it does something or is usable in your program, however that is it. Cor Show quoteHide quote "Steven" <a@a.com> schreef in bericht news:Ov0OnxGLGHA.3972@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. > 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. Show quoteHide quote "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message news:ukL0eeHLGHA.1424@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.windows.forms.control.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:Ov0OnxGLGHA.3972@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. >> > > Activator.CreateInstance(Assembly.GetExecutingAssembly().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" Show quoteHide quote "Steven" <a@a.com> wrote in message news:epye0%23HLGHA.668@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]" <notmyfirstn***@planet.nl> wrote in message > news:ukL0eeHLGHA.1424@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.windows.forms.control.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:Ov0OnxGLGHA.3972@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. >>> >> >> > > "Steven" <a@a.com> schrieb: <URL:http://dotnet.mvps.org/dotnet/code/techniques/#ClassByName>> 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"). -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/>
System.IO.File.Exists
HTML in to readable/value accessible object Help Displaying & Stabilizing PictureBox Contents passing a list as a parameter to a TableAdapter Fill method Text file printout in dos mode through VB.Net or DOS command from VB.Net run a dos command Designing A Process and Report Scheduler/Spooler Application Loading HTML into an HTMLDoc problem calling vbscript Checking strings are alphanumeric |
|||||||||||||||||||||||