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. ListView docking under ToolStrip problem

ListView docking under ToolStrip problem

Scheduled Pinned Locked Moved C#
designhelpquestion
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.
  • C Offline
    C Offline
    Chesnokov Yuriy
    wrote on last edited by
    #1

    There is a wierd problem: in the windows form I added ToolStrip, which docks to top and then added ListView to span entire form by design. When I set its dock property to Fill it was docked below ToolStrip. I expected the docking would not interfere with ToolStrip and stop exactly at its bottom border? Thus ToolStrip occludes by itself top part of the ListView control.

    Чесноков

    L 1 Reply Last reply
    0
    • C Chesnokov Yuriy

      There is a wierd problem: in the windows form I added ToolStrip, which docks to top and then added ListView to span entire form by design. When I set its dock property to Fill it was docked below ToolStrip. I expected the docking would not interfere with ToolStrip and stop exactly at its bottom border? Thus ToolStrip occludes by itself top part of the ListView control.

      Чесноков

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

      Select the ListView control, click Ctrl+X (Cut), click the form and then click Ctrl+V (Paste). Your problem should be solved. This weird problem happens because docking depends on the order in which controls are added to the form.

      C B 2 Replies Last reply
      0
      • L Lost User

        Select the ListView control, click Ctrl+X (Cut), click the form and then click Ctrl+V (Paste). Your problem should be solved. This weird problem happens because docking depends on the order in which controls are added to the form.

        C Offline
        C Offline
        Chesnokov Yuriy
        wrote on last edited by
        #3

        many thanks that solved the problem. I never paid attention to the addition order of the controls to the form. I remeber there were no problems with docking before due to that issue as it turned out

        Чесноков

        L 1 Reply Last reply
        0
        • C Chesnokov Yuriy

          many thanks that solved the problem. I never paid attention to the addition order of the controls to the form. I remeber there were no problems with docking before due to that issue as it turned out

          Чесноков

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

          you're welcome.

          1 Reply Last reply
          0
          • L Lost User

            Select the ListView control, click Ctrl+X (Cut), click the form and then click Ctrl+V (Paste). Your problem should be solved. This weird problem happens because docking depends on the order in which controls are added to the form.

            B Offline
            B Offline
            BobJanova
            wrote on last edited by
            #5

            You can also do it with Move to Front/Back on the controls. Send the toolbar to the back.

            L 1 Reply Last reply
            0
            • B BobJanova

              You can also do it with Move to Front/Back on the controls. Send the toolbar to the back.

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

              It's not about the z-order Bob, it's how the docking mechanism works in WinForms. Sending the Toolbar back will permanently hide it behind the ListView at runtime.

              B 1 Reply Last reply
              0
              • L Lost User

                It's not about the z-order Bob, it's how the docking mechanism works in WinForms. Sending the Toolbar back will permanently hide it behind the ListView at runtime.

                B Offline
                B Offline
                BobJanova
                wrote on last edited by
                #7

                It is not about the Z order, true, but 'Send to Front/Back' in the VS designer changes the creation order of the components, so it changes the docking order. By default the Z order is also based on the creation order so the function kind of does both things. I've had to do this myself for docked controls and splitters.

                L 1 Reply Last reply
                0
                • B BobJanova

                  It is not about the Z order, true, but 'Send to Front/Back' in the VS designer changes the creation order of the components, so it changes the docking order. By default the Z order is also based on the creation order so the function kind of does both things. I've had to do this myself for docked controls and splitters.

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

                  It works :-), Nice trick, thanks.

                  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