473,396 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Tab Control Design and coding Help needed!

Off on another journey through vb.net.

What I want to do now is have a tab-control with 1 to 8 tab-pages for
categories. I've read where there is not a hide method so I guess
I'll have to tabpage.remove and tabpage.add at execution time.

On each tab-page I will have a datagrid (parent) and a couple of other
controls (radio buttons, labels, checkboxes, etc). Below the
tab-control will be a datagrid showing related data (child info) for
the selected

parent-row in the selected tab-page above it.

I'm in a quandry on how to set this up.

I can set up tab-page 1 and copy it to the other seven pages at design
time. How do I do it at run time since I'm changing the number of
tab-pages to display?

I seem to remember there was a way to have the same controls on each
page (without duplication - eg; having only one datagrid (just
changing to a different query string of the data set for each
tab-page) and visible on each tab-page). Surely I dont have to setup
8 datagrids, do I?

The data for the parent datagrid on each tab-page comes from the same
table (just different records based on category).

If I have to add and remove tab-pages at run-time, how do I easily
position all controls on that page?

I hope I've made this clear enough. Looking for recommendations,
references, code examples.

Thanks,

Hexman
Dec 9 '05 #1
2 2197
Hexman,

I think that the first thing you have to start with is reading about "User
Controls on MSDN"

http://search.microsoft.com/search/r...rols&View=msdn

All your questions are about that.

I hope this helps,

Cor
Dec 9 '05 #2
If I understand correctly, you want one set of controls which will be common
to all tabpages.

One simple solution:
At Form Load() set up an ArrayList of the Controls on the First TabPage for
easy reference and in the TabControls SelectedIndexChanged() method reparent
these controls to the SelectedTabPage.

\\\
Private MyControls As ArrayList

Private Sub MainForm_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
MyControls = New ArrayList(TabPage1.Controls)
End Sub

Private Sub TabControl1_SelectedIndexChanged(ByVal sender As System.Object,
_
ByVal e As System.EventArgs) Handles
TabControl1.SelectedIndexChanged
If Not (TabControl1.Created) Then Return
For Each ctrl As Control In MyControls
TabControl1.SelectedTab.Controls.Add(ctrl)
Next
'Maybe call a custom RefreshDataGrid() method here
End Sub
///

Another Solution is to place the controls above the TabControl rather than
on a TabPage. This is more difficult to maintain at DesignTime as any
inadvertant dragging and dropping of the controls will result in them being
parented to the Tabpage. This would be the preffered method though as you
shouldn't get the flickering that you'll get with the first method.

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Hexman" <He****@binary.com> wrote in message
news:7q********************************@4ax.com...
Off on another journey through vb.net.

What I want to do now is have a tab-control with 1 to 8 tab-pages for
categories. I've read where there is not a hide method so I guess
I'll have to tabpage.remove and tabpage.add at execution time.

On each tab-page I will have a datagrid (parent) and a couple of other
controls (radio buttons, labels, checkboxes, etc). Below the
tab-control will be a datagrid showing related data (child info) for
the selected

parent-row in the selected tab-page above it.

I'm in a quandry on how to set this up.

I can set up tab-page 1 and copy it to the other seven pages at design
time. How do I do it at run time since I'm changing the number of
tab-pages to display?

I seem to remember there was a way to have the same controls on each
page (without duplication - eg; having only one datagrid (just
changing to a different query string of the data set for each
tab-page) and visible on each tab-page). Surely I dont have to setup
8 datagrids, do I?

The data for the parent datagrid on each tab-page comes from the same
table (just different records based on category).

If I have to add and remove tab-pages at run-time, how do I easily
position all controls on that page?

I hope I've made this clear enough. Looking for recommendations,
references, code examples.

Thanks,

Hexman

Dec 9 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ron Vecchi | last post by:
Could someone point me in the right direction for creating a control similar to the VS solution explorer where it will auto hide and open when needed. Thanks -- Ron Vecchi
17
by: No One | last post by:
Is there a way to keep a control centered inside a form without having to recalculate everytime the form is resized?
19
by: Dales | last post by:
I have a custom control that builds what we refer to as "Formlets" around some content in a page. These are basically content "wrapper" sections that are tables that have a colored header and...
1
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a...
2
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the...
3
by: eBob.com | last post by:
I have several applications which mine web sites for personal information which they publish. They publish the info in one form, I transform the info into Excel spreadsheets. So all these...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
10
by: gweasel | last post by:
What is the best way to apply a Validation Rule - or rather, where is the best place to put it? Is there an advantage to putting it on the field in the table vs setting the validation rule on the...
10
by: vital | last post by:
Hi, I am designing the middle tier of a project. It has 6 classes and microsoft application data access block. The six classes are DBServices, Logger, ProjectServices ... etc. and all these...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.