Form, Tabs and Controls --- Resizing Them
-
Hey all, I've been playing with this for two days now and I cannot get this to work. I have a form, two TabControls on the form. In one of the TabControls, I have a datagrid in there along with a textbox and a search button. I am trying to get the auto-resize anchor/dock functions working correctly, but nothing that I do seems to work. I've tried panels, splitters, using the Anchor/Dock methods every way I can think, but it never displays properly. Basically, it looks like this: [SEARCH TEXT BOX] [SEARCH BUTTON] * DATA GRID HERE TAKING UP REST OF THE SCREEN(TAB) * I want it so that when the user resizes the form, it leaves the search text box and the search button on the top (not resize them and make them huge), but only resizes the datagrid to take up the remaining space. When I play with all the different features, the datagrid usually ends up overtaking the space where the search bar/button is, and it overlaps. I'm clueless as to how to make this work properly. Any help would be appreciated.
-
Hey all, I've been playing with this for two days now and I cannot get this to work. I have a form, two TabControls on the form. In one of the TabControls, I have a datagrid in there along with a textbox and a search button. I am trying to get the auto-resize anchor/dock functions working correctly, but nothing that I do seems to work. I've tried panels, splitters, using the Anchor/Dock methods every way I can think, but it never displays properly. Basically, it looks like this: [SEARCH TEXT BOX] [SEARCH BUTTON] * DATA GRID HERE TAKING UP REST OF THE SCREEN(TAB) * I want it so that when the user resizes the form, it leaves the search text box and the search button on the top (not resize them and make them huge), but only resizes the datagrid to take up the remaining space. When I play with all the different features, the datagrid usually ends up overtaking the space where the search bar/button is, and it overlaps. I'm clueless as to how to make this work properly. Any help would be appreciated.
Hi shultas, Give the following a try: Search Text Box Settings First, make sure the
Dock
property is set to "None". Set theAnchor
property to Left, Top, Right. This should make the text box expand its width, but not its height when the form is expanded. Search Button Settings Again, make sureDock
is set to "None". Set theAnchor
property to Top, Right. This should make the search button attach itself to the right side of the form when the form is expanded, but keep its width the same. Data Grid Settings Make sureDock
is set to "None". Set theAnchor
property to Left, Top, Right, Bottom. This should make the data grid expand its width and height with the form when it is resized. Tab Control Settings I'm not sure where your two tab controls are positioned relative to the form, but you'll need to adjust theAnchor
property of the tab control which contains the data grid, search text box, and search button. I think you'd probably want to set theAnchor
property to Left, Top, Right, Bottom, so that it gets its share of the extra horizontal and vertical space when the form is expanded. Give those settings a shot. If it doesn't work, please let me know and I'll try to help you as best I can. Sincerely, Alexander Wiseman