Results 1 to 3 of 3

Thread: Newbie-question opening forms

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    6

    Newbie-question opening forms

    Hi

    I'm a total newbie at vb.net, so don't shoot me for a stupid question :-)

    We have a table that we use to create a menubar.
    in that table, we place the caption of the menu-item, the action (for example, openform)
    and a parameter (for example the form that needs to be opened)
    (we use this structure a lot in older access and vb6-applications)


    The problem in .net is : we can't seem to get hold of the forms !
    so the thing is : I read the table, get a formname that i need to open, but i can't open it :-)
    (and we don' want to hardcode the formnames)

    I could open all the forms at startup and unhide them when i need them?
    anyone any idea?

    thanks in advance
    greetz
    Frank

  2. #2
    Lively Member carl_mathews200's Avatar
    Join Date
    May 2004
    Location
    Wales, UK
    Posts
    94
    Edit: sorry, i just tested that and it wont work,

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    6
    i think i found the solution :-)


    Dim myType As Type = Type.GetType("WindowsApplication1.Form1")
    Dim myForm As Object = System.Activator.CreateInstance(myType)
    myType.GetMethod("Show").Invoke(myForm, Nothing)


    thx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width