Calling a Dynamic form

Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Oct 2006
Posts: 169
Reputation: ptaylor965 is an unknown quantity at this point 
Solved Threads: 19
Sponsor
ptaylor965's Avatar
ptaylor965 ptaylor965 is offline Offline
Junior Poster

Calling a Dynamic form

 
0
  #1
Jun 20th, 2007
I have a SQL table with a list of forms (frmForm1, frmForm2)

i have a listbox that fills from this table and i would like it to call the form in the 'FormToCall' Column


How can i call a form if i only know the form name at runtime?
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 812
Reputation: arjunsasidharan is on a distinguished road 
Solved Threads: 13
arjunsasidharan's Avatar
arjunsasidharan arjunsasidharan is offline Offline
Practically a Posting Shark

Re: Calling a Dynamic form

 
0
  #2
Jun 20th, 2007
i didn't understand what your saying here?

Try declaring an object for the form2 and call it at runtime..
There is just two ways to live your life.
One is as though nothing is a miracle.
The other is as if everything is.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 169
Reputation: ptaylor965 is an unknown quantity at this point 
Solved Threads: 19
Sponsor
ptaylor965's Avatar
ptaylor965 ptaylor965 is offline Offline
Junior Poster

Re: Calling a Dynamic form

 
1
  #3
Jun 20th, 2007
I have found the solution

  1. Dim assem As Reflection.Assembly = Me.GetType.Assembly
  2. Dim frm As Form = assem.CreateInstance(assem.GetName.Name & ".frmMaint")
  3. frm.Show()



Thanks
Last edited by ptaylor965; Jun 20th, 2007 at 9:46 am.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC