Answered by:
Visual Studio docking problems with controls?

Question
-
Hello everyone. I have a tabControl that I want to dock two seperate controls to. I think this I have done before, but I can't remember how I did this, and can't get this to work now... I would like to have one control (A panel) docked to the top of the tabControl and a dataGridView docked to Fill the remaining area of the tabControl. When I do this though, the dataGridView fills the WHOLE tabControl and some of it appears behind the panel control. Does anyone know what I am doing wrong, or how to do this? I thank you for your helps.
Thank you.Monday, October 8, 2007 6:19 PM
Answers
-
I had a similar problem recently. I'm assuming that the dataGridView Control was there (And docked to the tabControl) before you added the panel? I noticed that when that is the case the dataGridView (And other controls as well) will not recognize that the other control is there. To fix this you can replace the dataGridView, or do the following:
Set the dataGridView's dock property to "None"
Select the dataGridView
Use Ctrl+X to cut the dataGridView
Select the tabControl Panel that you want this dataGridView on (Making sure the panel is already there and docked where you want it)
Use Ctrl+V to paste the dataGridView into the tabControl Panel.
Set the dataGridView's dock property to "Fill".
That should do it.
If not, post back.
Hope that helps.Monday, October 8, 2007 6:35 PM
All replies
-
I had a similar problem recently. I'm assuming that the dataGridView Control was there (And docked to the tabControl) before you added the panel? I noticed that when that is the case the dataGridView (And other controls as well) will not recognize that the other control is there. To fix this you can replace the dataGridView, or do the following:
Set the dataGridView's dock property to "None"
Select the dataGridView
Use Ctrl+X to cut the dataGridView
Select the tabControl Panel that you want this dataGridView on (Making sure the panel is already there and docked where you want it)
Use Ctrl+V to paste the dataGridView into the tabControl Panel.
Set the dataGridView's dock property to "Fill".
That should do it.
If not, post back.
Hope that helps.Monday, October 8, 2007 6:35 PM -
Thank you so much for your helps. That is my problem. I using your steps fixed it. Is this a bug in Visual Studio? It seems odd behaviors....
Thank you very much.Monday, October 8, 2007 6:44 PM -
The problem occurs in visual studio 2008. Your solution still works.Sunday, July 19, 2009 3:53 PM
-
Lol, it is still a problem in visual studio 2010 and the solution still works!
Regards,
Annihil8Tuesday, March 8, 2011 2:50 PM -
It's because the docking system uses the control depth to see how to fill.
A simple [right click] > [bring to front] will also solve your problem, and it won't remove the event listeners ;)
- Edited by Niels Festjens Thursday, March 24, 2011 3:36 PM typo
Thursday, March 24, 2011 3:35 PM