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. WPF
  4. Stack panel

Stack panel

Scheduled Pinned Locked Moved WPF
winformsdockerdata-structurestutorialquestion
3 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.
  • C Offline
    C Offline
    columbos14927
    wrote on last edited by
    #1

    Hello, I want to add dynamically many controls to a window. I wanted to use a stack panel container but a stack panel has either horizontal or vertical orientation. I want to add the control horizontally and when there are three user controls in one row i want to go to next row and start adding the controls there and so on. The user can also delete a control so the other controls have to be reorganized automatically. Any one has an idea how to do it? Thanks.

    L M 2 Replies Last reply
    0
    • C columbos14927

      Hello, I want to add dynamically many controls to a window. I wanted to use a stack panel container but a stack panel has either horizontal or vertical orientation. I want to add the control horizontally and when there are three user controls in one row i want to go to next row and start adding the controls there and so on. The user can also delete a control so the other controls have to be reorganized automatically. Any one has an idea how to do it? Thanks.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Use a "UniformGrid" with 3 columns for organizing the controls, and the .Children.Add method to add controls. Use the .Children.Remove method to "delete" a control.

      1 Reply Last reply
      0
      • C columbos14927

        Hello, I want to add dynamically many controls to a window. I wanted to use a stack panel container but a stack panel has either horizontal or vertical orientation. I want to add the control horizontally and when there are three user controls in one row i want to go to next row and start adding the controls there and so on. The user can also delete a control so the other controls have to be reorganized automatically. Any one has an idea how to do it? Thanks.

        M Offline
        M Offline
        Mycroft Holmes
        wrote on last edited by
        #3

        I used a wrap panel from the tool kit for this, bind it to a collection and add/delete the items in the collection.

        Never underestimate the power of human stupidity RAH

        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