Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Opening Forms

Opening Forms

Scheduled Pinned Locked Moved Visual Basic
csharpvisual-studiohelp
6 Posts 3 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pete Newman
    wrote on last edited by
    #1

    VS 2005 (VB.Net) Is it possible to open a form by a string name without having to declare the form first , ie normally you would Dim SomeForm as New FormName SomeForm.Show What i wasnt yo do is create a dynamic form, and when the user clicks a button it open a corraspoinding form. As each user will have different 'buttons' on there forms i want to have a routine that i can parm a formname in as a string and it open the form. ie Dim FormName as String = 'SomeFormName' FormName.Show Any idea's :^)

    I really do need help..... all this computer stuff is way over my head !!

    T N 2 Replies Last reply
    0
    • P Pete Newman

      VS 2005 (VB.Net) Is it possible to open a form by a string name without having to declare the form first , ie normally you would Dim SomeForm as New FormName SomeForm.Show What i wasnt yo do is create a dynamic form, and when the user clicks a button it open a corraspoinding form. As each user will have different 'buttons' on there forms i want to have a routine that i can parm a formname in as a string and it open the form. ie Dim FormName as String = 'SomeFormName' FormName.Show Any idea's :^)

      I really do need help..... all this computer stuff is way over my head !!

      T Offline
      T Offline
      The ANZAC
      wrote on last edited by
      #2

      No i don't think so. Why do you need to do it this way?

      Posted by The ANZAC

      P 1 Reply Last reply
      0
      • T The ANZAC

        No i don't think so. Why do you need to do it this way?

        Posted by The ANZAC

        P Offline
        P Offline
        Pete Newman
        wrote on last edited by
        #3

        I do know thre is a way of doing this, as i have seen the code, just carnt remember it. The reason i want to do it this way is that there are a number of users that will be using this application, each one on them will have a 'main selection screen' which will have upwards of 20+ options. each option will open a new form. NOT all the operators will have the same options so rather than have a while load of code declaring every form, i just want a small simple routine.

        I really do need help..... all this computer stuff is way over my head !!

        1 Reply Last reply
        0
        • P Pete Newman

          VS 2005 (VB.Net) Is it possible to open a form by a string name without having to declare the form first , ie normally you would Dim SomeForm as New FormName SomeForm.Show What i wasnt yo do is create a dynamic form, and when the user clicks a button it open a corraspoinding form. As each user will have different 'buttons' on there forms i want to have a routine that i can parm a formname in as a string and it open the form. ie Dim FormName as String = 'SomeFormName' FormName.Show Any idea's :^)

          I really do need help..... all this computer stuff is way over my head !!

          N Offline
          N Offline
          Navneet Hegde
          wrote on last edited by
          #4

          :rose:yes its Absolutely possible to do so and can be done very neatly in VB2.0,Just give me a day I will post the Code snippet . but before that I want to know you require that and how you got this nagging idea Navneet.Hegde navneethegde@yahoo.co.in Live Life Kingsize

          P 1 Reply Last reply
          0
          • N Navneet Hegde

            :rose:yes its Absolutely possible to do so and can be done very neatly in VB2.0,Just give me a day I will post the Code snippet . but before that I want to know you require that and how you got this nagging idea Navneet.Hegde navneethegde@yahoo.co.in Live Life Kingsize

            P Offline
            P Offline
            Pete Newman
            wrote on last edited by
            #5

            we have an inhouse menu type application, when a operator logs onto the stytem , ihave a function that dynamicly creates the menu oprtions for this operator from there profile. ie in design tine the form is blank, but buttons ( options buttons ) , and click even handlers are generated for all the area's they are allowed to access. this info is held in a SQL2005 table ie .. Operator 1 can access area's 1,2,3, and 4 so would have 4 buttons on screen , Operator 2 can only access area's 1 and 4 hance only has two buttons. As the buttons are dynamicly generated the indexes ( start at 0 ) are never the same. in the example above operator button index 1 would be for Area 2 where as for operator 2 it would be for area 4 i have a work round by Dimming every form and then using the button text in a case statement to determine which button was clicked, but that means every time i add a new form i have to remember to add it in the select case statement ... If i can use the form name form the SQL table in a simple routine it will save endless pages of coding and i wont have tp remember to keep comming back to the master form and adding the reference in its the simple idea's that prove to be the hardest !!

            I really do need help..... all this computer stuff is way over my head !!

            N 1 Reply Last reply
            0
            • P Pete Newman

              we have an inhouse menu type application, when a operator logs onto the stytem , ihave a function that dynamicly creates the menu oprtions for this operator from there profile. ie in design tine the form is blank, but buttons ( options buttons ) , and click even handlers are generated for all the area's they are allowed to access. this info is held in a SQL2005 table ie .. Operator 1 can access area's 1,2,3, and 4 so would have 4 buttons on screen , Operator 2 can only access area's 1 and 4 hance only has two buttons. As the buttons are dynamicly generated the indexes ( start at 0 ) are never the same. in the example above operator button index 1 would be for Area 2 where as for operator 2 it would be for area 4 i have a work round by Dimming every form and then using the button text in a case statement to determine which button was clicked, but that means every time i add a new form i have to remember to add it in the select case statement ... If i can use the form name form the SQL table in a simple routine it will save endless pages of coding and i wont have tp remember to keep comming back to the master form and adding the reference in its the simple idea's that prove to be the hardest !!

              I really do need help..... all this computer stuff is way over my head !!

              N Offline
              N Offline
              Navneet Hegde
              wrote on last edited by
              #6

              :-O:-O:-Ook dear I will just post it as i get back to my PC . I just wanted to know the reason for reaching this end of programming . my reason for digging this code is that we wanted to build application dynamically and form name were all in database Navneet.Hegde navneethegde@yahoo.co.in navneethegde@gmail.com navneet.hegde@procit.com Live Life Kingsize

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups