Groups | Blog | Home
all groups > dotnet windows forms > september 2004 >

dotnet windows forms : Using the same components and controls in multiple tabs?


Kenton Smith
9/26/2004 3:37:37 AM
How can I use the same controls and components in more then 1 tab
collection?

The tab control covers the entire window. The different tabs are going to
contain some unique components and some common components. I do not want to
have repeat the common parts.

Thanks

Mick Doherty
9/26/2004 5:03:23 PM
Or just reparent the controls on SelectedIndexChanged().

\\\
Private CommonControls() As Control

Private Sub Form_Load(...)...
CommonControls = New Control(){Button1, TextBox1, CheckBox1}
End Sub

Private Sub TabControlX_SelectedIndexChanged(...)...
If CommonControls Is Nothing Then Return
TabControlX.SelectedTab.Controls.AddRange(CommonControls)
End Sub
///

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html


[quoted text, click to view]


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.742 / Virus Database: 495 - Release Date: 19/08/2004

Sijin Joseph
9/26/2004 7:53:44 PM
You can put the common controls on a UserControl and then use that
UserControl on the tab pages.

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph


[quoted text, click to view]
AddThis Social Bookmark Button