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. Adding controls to FlowLayoutPanel

Adding controls to FlowLayoutPanel

Scheduled Pinned Locked Moved C#
performancequestion
2 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.
  • Z Offline
    Z Offline
    zaboboa
    wrote on last edited by
    #1

    Hello, I am adding a bunch of usercontrols to a flow layout panel, but it takes a very long time for the controls to show up in the flowpanel. Is there a way to speed up the process? There are almost 600 controls that are added to the flowpanel. Thank you

    S 1 Reply Last reply
    0
    • Z zaboboa

      Hello, I am adding a bunch of usercontrols to a flow layout panel, but it takes a very long time for the controls to show up in the flowpanel. Is there a way to speed up the process? There are almost 600 controls that are added to the flowpanel. Thank you

      S Offline
      S Offline
      Scott Dorman
      wrote on last edited by
      #2

      Are you creating the controls individually and then adding them to the panel by calling panel.Controls.Add? You might want to create your controls and add them to an array or List<Control>. Once all of the controls have been created, add them to the panel by calling panel.Controls.AddRange. This should provide some noticeable speed improvements. Also, be sure to call SuspendLayout before you start adding controls and then ResumeLayout `when you are done. ----------------------------- In just two days, tomorrow will be yesterday.`

      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