Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Saturday, August 16, 2008 2:28 PM
Hello all,
Forgive me if this is a noob question, but I have done some searching and can't find any kind of answer. I want to place a group of controls ON TOP of a tab control; so that the controls are visible and usable no matter what tab page the user is on. It sounds simple, but whenever I drag a control on top of the tab page in the designer, it automatically puts the control on to whatever page is currently selected. I've tried the 'bring to front' action, but because the control is IN the tab page, that doesn't help.
I'm converting an Access program to C#/SQL Server and this can be done easily in Access, so I figured it wouldn't be any problem. But alas, I can't figure out how to do it.
Any help/suggestions are much appreciated.
All replies (6)
Saturday, August 16, 2008 2:43 PM âś…Answered | 1 vote
You will need to "fake" it out. Put your controls somewhere else on the form so that they are not within the bounds of the TabControl. If you have several controls, it may be helpful to group them by putting them in a Panel. Next, highlight these controls (or just the Panel, if you are using one) Use the arrow keys (not the mouse) to move them over top the TabControl. If they go beneath the TabControl, use the Format, Order, Bring to Front menu command. That is all there is to it.
Note that using the View, Other Window, Document Outline can be useful for troubleshooting container issues such as this.
Note that the best forum for Windows Forms questions is: http://forums.microsoft.com/msdn/showforum.aspx?forumid=8&siteid=1
Saturday, August 16, 2008 2:39 PM
Maybe put a Horizontal SplitterPanel on the form, then within the lower splitterpanel you place the tabs? The top panel will always be visible.
Saturday, August 16, 2008 2:50 PM
I was afraid this was the only way. The problem with this approach is that the panel's background (if set to transparent) remains the back color of the form, while the tab control has it's own background. I guess if you want to use a panel, if you have to place it in the same spot on ever page and then move the controls one by one. I can't believe something so easy in the Access IDE is impossible in Visual Studio without slow-going workarounds. Oh well, i appreciate the help. Sorry about the mis-posting.
Saturday, August 16, 2008 2:57 PM
The Microsoft Access form designer (and report designer too) was ahead of its time! Many things that I recall being easy to do in Access over 10 years ago never translated well into features in .NET.
Note that some third party tab controls available for .NET provide better support for sharing controls on multiple pages. You could also consider implementing your shared controls as a UserControl and then just instantiating it on every TabPage. Alternatively, put the shared controls in a Panel, handle the event that indicates that the current tab is changing: in code, remove the Panel from its previous TabPage and put it on the TabPage being activated.
Saturday, August 16, 2008 3:15 PM
Thank you very much for your last idea! I actually am using third party components (both panel and tab control) and there is a perfect event in the tab control to handle this. Two lines of code and no visible screen-updating. Thanks again for the idea.
Thursday, February 16, 2012 7:26 AM
Could you please tell, which third party control did you use and how did you achieve this functionality??
I have the same issue, where i have a tab control(with a specific background), in the header section there are some 10 controls(with same back ground) which are common to all tab pages. I want all common controls to be appeared on all tab pages, and also they shold have a relationship with the tab pages(say, if a button is clicked, it should redirect me to the desired tab page)
any call on the issue would be greatly appreciated.
Thanks