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. add button in run time

add button in run time

Scheduled Pinned Locked Moved C#
databasehelp
8 Posts 3 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.
  • N Offline
    N Offline
    Nabawoka
    wrote on last edited by
    #1

    i have table in DB (id,name) and have form with panel if i have 5 names in table have 5 buttons in this panel each one beside each other i want if user add any row in this table dynamically when form load add button beside last one to the end of panel and if add another add at bottom of this buttons and sidebar appear it's difficult to make this buttons add in runtime beside other ... and table can contain 100 rows :S:S so plz i need help in this :)

    P N 2 Replies Last reply
    0
    • N Nabawoka

      i have table in DB (id,name) and have form with panel if i have 5 names in table have 5 buttons in this panel each one beside each other i want if user add any row in this table dynamically when form load add button beside last one to the end of panel and if add another add at bottom of this buttons and sidebar appear it's difficult to make this buttons add in runtime beside other ... and table can contain 100 rows :S:S so plz i need help in this :)

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      Mohamed Nabawy wrote:

      it's difficult to make this buttons add in runtime beside other

      No it isn't, but I expect you will run out of room and I doubt your users will like it. Maybe you want a ComboBox or a TabControl?

      N 2 Replies Last reply
      0
      • P PIEBALDconsult

        Mohamed Nabawy wrote:

        it's difficult to make this buttons add in runtime beside other

        No it isn't, but I expect you will run out of room and I doubt your users will like it. Maybe you want a ComboBox or a TabControl?

        N Offline
        N Offline
        Nabawoka
        wrote on last edited by
        #3

        first thanks ,i know what u say :).. but i wanna to make it ana my boss need this :D :D

        P 1 Reply Last reply
        0
        • P PIEBALDconsult

          Mohamed Nabawy wrote:

          it's difficult to make this buttons add in runtime beside other

          No it isn't, but I expect you will run out of room and I doubt your users will like it. Maybe you want a ComboBox or a TabControl?

          N Offline
          N Offline
          Nabawoka
          wrote on last edited by
          #4

          i will use it in touch screen So buttons is better than combobox

          1 Reply Last reply
          0
          • N Nabawoka

            i have table in DB (id,name) and have form with panel if i have 5 names in table have 5 buttons in this panel each one beside each other i want if user add any row in this table dynamically when form load add button beside last one to the end of panel and if add another add at bottom of this buttons and sidebar appear it's difficult to make this buttons add in runtime beside other ... and table can contain 100 rows :S:S so plz i need help in this :)

            N Offline
            N Offline
            Nabawoka
            wrote on last edited by
            #5

            i need if row add automatic add button in runtime and be fixed once another row added not every time add all rows in runtime ? ... are this available ?

            A 1 Reply Last reply
            0
            • N Nabawoka

              i need if row add automatic add button in runtime and be fixed once another row added not every time add all rows in runtime ? ... are this available ?

              A Offline
              A Offline
              Abhinav S
              wrote on last edited by
              #6

              Yes. It should be possible - however, you need to try it out.

              N 1 Reply Last reply
              0
              • A Abhinav S

                Yes. It should be possible - however, you need to try it out.

                N Offline
                N Offline
                Nabawoka
                wrote on last edited by
                #7

                iam tring now.. and i havn't any idea how to add tool in runtime and make it fixed not evey time add from 0 ?

                1 Reply Last reply
                0
                • N Nabawoka

                  first thanks ,i know what u say :).. but i wanna to make it ana my boss need this :D :D

                  P Offline
                  P Offline
                  PIEBALDconsult
                  wrote on last edited by
                  #8

                  Mohamed Nabawy wrote:

                  my boss need this

                  Bosses rarely know what they need or want. :-D Most times you need to tell them what they need. Adding a Button at runtime is easy: 0) Instantiate it 1) Set the Text 2) Set the Location 3) Attach event handlers as needed 4) Add it to the Controls collection of the parent (Form)

                  System.Windows.Forms.Button b = new System.Windows.Forms.Button () ;
                  b.Text = "Push me" ;
                  b.Location = new System.Drawings.Point ( x , y ) ;
                  b.Click += someclickhandler ;
                  this.Controls.Add ( b ) ;

                  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