473,563 Members | 2,709 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2206
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 SelectedIndexCh anged() method reparent
these controls to the SelectedTabPage .

\\\
Private MyControls As ArrayList

Private Sub MainForm_Load(B yVal sender As System.Object, _
ByVal e As System.EventArg s) Handles MyBase.Load
MyControls = New ArrayList(TabPa ge1.Controls)
End Sub

Private Sub TabControl1_Sel ectedIndexChang ed(ByVal sender As System.Object,
_
ByVal e As System.EventArg s) Handles
TabControl1.Sel ectedIndexChang ed
If Not (TabControl1.Cr eated) Then Return
For Each ctrl As Control In MyControls
TabControl1.Sel ectedTab.Contro ls.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.c om...
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
2743
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
6868
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
2961
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 provide an open TD with a DIV in it for the content of this formlet. (The DIV is for DHTML to hide and show the content) I've created a web page...
1
7553
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 dropdown in UC1 _________________________ 1) MainPage_Load 2) User Control_1 Load
2
3163
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 problems that I have encountered to date and the solutions (if any) that I found....
3
1632
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 programs pick up name, telephone number, age, sex, etc.. And as they pick up the information they display it in text boxes. The text boxes are display...
15
6491
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 accept other controls. The control i drag drop on it becomes the child of my custom control's parent form and not the child of my custom control. Then...
10
5700
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 form the control is on? Basically I have a number of controls in a form that are required, and to check it I am setting the Validation Rule to...
10
3635
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 classes talk to front-end directly. Do I need to use any design pattern in this? or what kind of design pattern is this?
0
7583
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8106
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7948
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6250
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3642
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
923
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.