ListView docking under ToolStrip problem
-
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.
Чесноков
-
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.
Чесноков
-
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.
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
Чесноков
-
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
Чесноков
-
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.
-
You can also do it with Move to Front/Back on the controls. Send the toolbar to the back.
-
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.
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.
-
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.