how to call a form in vb.net dynamically

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • varunbhatia87
    New Member
    • Apr 2009
    • 3

    how to call a form in vb.net dynamically

    I am developing an application in vb.net, in which i m using a treeview control which display nodes generated from database, when i select a node it gives me a form name that comes also from datahase, now i have to call this form. how it should be??

    Can any one help.
    Last edited by debasisdas; Apr 28 '09, 05:00 AM. Reason: moved to .net forum.
  • artov
    New Member
    • Jul 2008
    • 40

    #2
    What do you mean by form name? Name property of the Control class or something else? And more important, what do you mean by calling form? Do you mean creating the form, and then sending ShowDialog or is the form already created, but possible hidden?

    Comment

    • varunbhatia87
      New Member
      • Apr 2009
      • 3

      #3
      calling of form dynamically

      Originally posted by artov
      What do you mean by form name? Name property of the Control class or something else? And more important, what do you mean by calling form? Do you mean creating the form, and then sending ShowDialog or is the form already created, but possible hidden?
      My application have various form..not hidden..name of the forms are saved in data base...in the treeview when i select a particular form..it gives me the form name ..which is in string format..now i want to show the selected form.

      Comment

      • Curtis Rutland
        Recognized Expert Specialist
        • Apr 2008
        • 3264

        #4
        I would use a select case statement, and just compare the value to constant strings, then launch the proper form when cases match.

        Comment

        • Frinavale
          Recognized Expert Expert
          • Oct 2006
          • 9749

          #5
          Could reflection help you at all here?
          When you're referring to the Form Name are you referring to the variable name of an instance of the form? Or are you referring to the Name of the form?

          How did you save the form name into the database in the first place?
          Can you use the same logic in reverse to retrieve the form?

          Comment

          Working...