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. C#
  4. i want find a list of form of my application in code?

i want find a list of form of my application in code?

Scheduled Pinned Locked Moved C#
tutorialquestion
7 Posts 5 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.
  • C Offline
    C Offline
    combo_ci
    wrote on last edited by
    #1

    hi for example i want a list of windows form name in a combo box ? thnx

    G D 2 Replies Last reply
    0
    • C combo_ci

      hi for example i want a list of windows form name in a combo box ? thnx

      G Offline
      G Offline
      Gareth H
      wrote on last edited by
      #2

      combo_ci, If you are using an MDI form, you have a collection of them

      this.MdiChildren

      http://msdn2.microsoft.com/en-us/library/system.windows.forms.form.mdichildren.aspx[^] Regards, Gareth.

      C 1 Reply Last reply
      0
      • G Gareth H

        combo_ci, If you are using an MDI form, you have a collection of them

        this.MdiChildren

        http://msdn2.microsoft.com/en-us/library/system.windows.forms.form.mdichildren.aspx[^] Regards, Gareth.

        C Offline
        C Offline
        combo_ci
        wrote on last edited by
        #3

        i dont using an MDI form ...!!!

        S 1 Reply Last reply
        0
        • C combo_ci

          i dont using an MDI form ...!!!

          S Offline
          S Offline
          Spacix One
          wrote on last edited by
          #4

          What would the purpose of said list be? Are you wanting to control the forms such as showing/hiding them or some other type master/slave function between the forms? Just making a list of winforms wouldn't do much without other interfaces between each form. That being the case, how many forms are you using that you need a list of them? If you have so many you need a list then you should in most cases be using a MDI parent...


          -Spacix All your skynet questions[^] belong to solved

          C 1 Reply Last reply
          0
          • S Spacix One

            What would the purpose of said list be? Are you wanting to control the forms such as showing/hiding them or some other type master/slave function between the forms? Just making a list of winforms wouldn't do much without other interfaces between each form. That being the case, how many forms are you using that you need a list of them? If you have so many you need a list then you should in most cases be using a MDI parent...


            -Spacix All your skynet questions[^] belong to solved

            C Offline
            C Offline
            combo_ci
            wrote on last edited by
            #5

            i want to create a security pack that select a form name in application and set that a user can view or edit that form ... and save the name of form in database and in load of form with pass name of form to a sp an db find that user canVeiw Or Can Eidt

            L 1 Reply Last reply
            0
            • C combo_ci

              i want to create a security pack that select a form name in application and set that a user can view or edit that form ... and save the name of form in database and in load of form with pass name of form to a sp an db find that user canVeiw Or Can Eidt

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              Hi, you can get a list of all open forms from Application.OpenForms Property you can create a list of all existing forms using reflection; if you make them all inherit say MyFormBase and put them in a single assembly, then interrogate that assembly for any type inheriting from MyFormBase. Hope this helps.

              Luc Pattyn [Forum Guidelines] [My Articles]


              This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.


              1 Reply Last reply
              0
              • C combo_ci

                hi for example i want a list of windows form name in a combo box ? thnx

                D Offline
                D Offline
                darkelv
                wrote on last edited by
                #7

                You need to use reflection and look at each class's base form name (System.Windows.Forms.Form or your subclassed form class name, if any)

                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