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. initialize panel

initialize panel

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

    Hello, I have to do the follwing steps: 1) add controls to a panel programatically 2) make initialization steps in the added control (e.g. add labels) depending on the size it could be also that the added controls contains other subcontrols for which this steps are also needed... Normally I think the best way to do that is the Load event, isn't it? But in panel it isn't availaible. What is the best way to solve that? Regards Hansjörg

    G 1 Reply Last reply
    0
    • H hpetriffer

      Hello, I have to do the follwing steps: 1) add controls to a panel programatically 2) make initialization steps in the added control (e.g. add labels) depending on the size it could be also that the added controls contains other subcontrols for which this steps are also needed... Normally I think the best way to do that is the Load event, isn't it? But in panel it isn't availaible. What is the best way to solve that? Regards Hansjörg

      G Offline
      G Offline
      gnjunge
      wrote on last edited by
      #2

      Put it in the the constructor after Initialize()

      H 1 Reply Last reply
      0
      • G gnjunge

        Put it in the the constructor after Initialize()

        H Offline
        H Offline
        hpetriffer
        wrote on last edited by
        #3

        I don't like this solution very much, because a few properties are set after the instantiation. This properties affect the behaviour of the panel. Regards Hansjörg

        G 1 Reply Last reply
        0
        • H hpetriffer

          I don't like this solution very much, because a few properties are set after the instantiation. This properties affect the behaviour of the panel. Regards Hansjörg

          G Offline
          G Offline
          gnjunge
          wrote on last edited by
          #4

          Maybe hook on to Panel.ControlAdded . The problem is that this one gets fired after the addition of every one of your controls.

          H 1 Reply Last reply
          0
          • G gnjunge

            Maybe hook on to Panel.ControlAdded . The problem is that this one gets fired after the addition of every one of your controls.

            H Offline
            H Offline
            hpetriffer
            wrote on last edited by
            #5

            It seems that this is the only solution but it is more work to coding... Regards and thanks Hansjörg

            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