943,852 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Marked Solved
  • Views: 5282
  • VB.NET RSS
Jun 20th, 2007
0

Calling a Dynamic form

Expand Post »
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?
Similar Threads
Reputation Points: 16
Solved Threads: 19
Junior Poster
ptaylor965 is offline Offline
169 posts
since Oct 2006
Jun 20th, 2007
0

Re: Calling a Dynamic form

i didn't understand what your saying here?

Try declaring an object for the form2 and call it at runtime..
Reputation Points: 347
Solved Threads: 13
Practically a Posting Shark
arjunsasidharan is offline Offline
812 posts
since Aug 2006
Jun 20th, 2007
1

Re: Calling a Dynamic form

I have found the solution

VB.NET Syntax (Toggle Plain Text)
  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.
Reputation Points: 16
Solved Threads: 19
Junior Poster
ptaylor965 is offline Offline
169 posts
since Oct 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Online Play in Games Possible?
Next Thread in VB.NET Forum Timeline: TO retrieive all user account name





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC