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
  1. Home
  2. General Programming
  3. Visual Basic
  4. dynamically populate the hashtable

dynamically populate the hashtable

Scheduled Pinned Locked Moved Visual Basic
tutorial
4 Posts 2 Posters 0 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.
  • F Offline
    F Offline
    ferronrsmith
    wrote on last edited by
    #1

    I know how to use the hashtable. So far I have my program working by sending the forms to the hastable in code. Like so... dim ptr as windows.forms.form ptr = new frmOne hashtable.add(ptr) what I would like to do is replace the code above with code that will dynamically populate the hashtable, something to the effect of... if projecttype\object\whatever is a system.windows.forms.form then hashtable.add(projecttype\object\whatever) I can't figure out how to do it I tried using reflection.assembly.getexecutingassembly however a forms BaseType is not always stated as system.windows.forms.form it can also be the project namespace.formname, which completely negates the whole purpose of using it.

    Ferron

    D 1 Reply Last reply
    0
    • F ferronrsmith

      I know how to use the hashtable. So far I have my program working by sending the forms to the hastable in code. Like so... dim ptr as windows.forms.form ptr = new frmOne hashtable.add(ptr) what I would like to do is replace the code above with code that will dynamically populate the hashtable, something to the effect of... if projecttype\object\whatever is a system.windows.forms.form then hashtable.add(projecttype\object\whatever) I can't figure out how to do it I tried using reflection.assembly.getexecutingassembly however a forms BaseType is not always stated as system.windows.forms.form it can also be the project namespace.formname, which completely negates the whole purpose of using it.

      Ferron

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      I've got a bigger question. Why are you trying to do this at all?? What's the point of jumping through all these hoops?

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      F 1 Reply Last reply
      0
      • D Dave Kreskowiak

        I've got a bigger question. Why are you trying to do this at all?? What's the point of jumping through all these hoops?

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        F Offline
        F Offline
        ferronrsmith
        wrote on last edited by
        #3

        I need to create a hashtable collection of all the forms in my project. It needs to be done in code and it needs to be done without any user input. It also needs to be able to be portable from one project to another without rewritting any code, so the list needs to be created dynamically. Do u know how to achieve this, or can anyone point me in the correct direction? Thanks

        Ferron

        D 1 Reply Last reply
        0
        • F ferronrsmith

          I need to create a hashtable collection of all the forms in my project. It needs to be done in code and it needs to be done without any user input. It also needs to be able to be portable from one project to another without rewritting any code, so the list needs to be created dynamically. Do u know how to achieve this, or can anyone point me in the correct direction? Thanks

          Ferron

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          ferronrsmith wrote:

          I need to create a hashtable collection of all the forms in my project. It needs to be done in code and it needs to be done without any user input.

          I'll ask again. Why??

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          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