|
-
May 28th, 2010, 04:38 PM
#1
Thread Starter
Fanatic Member
Tab Item Question
How can I make the content of my tabitem a copy of another class in my solution?
-
May 28th, 2010, 04:46 PM
#2
Re: Tab Item Question
You are going to have to explain better and provide an example...
I think you should also point out to people that this is a WPF project and perhaps it should really be in the WPF forum rather than here.
-
May 28th, 2010, 06:31 PM
#3
Thread Starter
Fanatic Member
Re: Tab Item Question
Hi, Thanks I was going to post in the WPF forum but wasn't sure if this related to a WPF funtion or rather just a general tab control issue.
What I have is a code that add's and removes tabs to a tab control.
The main content part of this tab is going to be an instance of a usercontrol.xaml in my solution explorer.
-
May 28th, 2010, 07:15 PM
#4
Re: Tab Item Question
I'm pretty sure you can literally just set the Content property to an instance of your user control
EDIT: e.g:
Code:
Dim UsrCtrl As New UserControl1
TabControl1.Items.Add(New TabItem With {.Header = "test"})
DirectCast(TabControl1.Items(0), TabItem).Content = UsrCtrl
-
May 28th, 2010, 07:26 PM
#5
Thread Starter
Fanatic Member
Re: Tab Item Question
Thanks this works
Code:
If tabItem Is Nothing Then
tabItem = New TabItem()
tabItem.Header = "Password"
tabItem.Tag = "Pass"
Dim UsrCtrl As New HeaderBar
DirectCast(tabItem, TabItem).Content = UsrCtrl
tabs.Items.Insert(0, tabItem)
tabItem.Focus()
End If
Last edited by AirlineSim; May 28th, 2010 at 07:34 PM.
-
May 28th, 2010, 08:17 PM
#6
Thread Starter
Fanatic Member
Re: Tab Item Question
Oh, when it opens it's only as small as it needs to be, i want it to be as big as the tab control.
how can I do this?
-
May 29th, 2010, 06:51 AM
#7
Re: Tab Item Question
I think that will be down to properties you have set on your usercontrol - make sure you are not explicitly setting the Width and Height properties of the user control in XAML.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|