Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2007

Tip: Looking for answers? Try searching our database.

WPF TabControl - Hiding tab buttons conditionally

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
drewnoakes - 29 Aug 2007 18:56 GMT
In my application users generally only have one tab page and I'd like to hide
the tab page buttons (headers?) when this is the case.

I have not been able to find a way to do this.  Do I need to re-apply an
entire template to the tab control to have a handle into the appropriate
object, or can I access the default one?

Also, is there a more appropriate place to discuss WPF issues?  I've been
trying to use forums.microsoft.com but whenever I try to reply or create a
post it logs me out, bizarrely.

Many thanks,

Drew Noakes.
Henning Krause [MVP - Exchange] - 29 Aug 2007 20:34 GMT
Hello,

you should be able to add a style.trigger to the tabitem element and switch
the IsVisible (or IsEnabled if you want) property to false under certains
conditions. If you want to do this from code you should give the tabitem an
element name (tabitem.Name or x:Name if doesn't expose this) and access it
from your code-behind.

Kind regards,
Henning Krause

> In my application users generally only have one tab page and I'd like to
> hide
[quoted text clipped - 11 lines]
>
> Drew Noakes.
drewnoakes - 30 Aug 2007 09:26 GMT
Hi Henning,

I tried this, but my trigger caused the entire tab page to disappear.  My
situtation involves hiding the tab buttons when there's only one tab page to
display, and introducing the buttons when extra pages are added.  Perhaps
I've misunderstood your suggestion or my implementation wasn't correct.

Drew.

> Hello,
>
[quoted text clipped - 22 lines]
> >
> > Drew Noakes.
Henning Krause [MVP - Exchange] - 30 Aug 2007 19:04 GMT
Hello,

ok, I misunderstood your question here.

TabItem inherits from HeaderedContentControl. As such, it should have a
Header.

You can try to set the header content to null with a style trigger. Or
manipulate the HeaderTemplate property.

Albeit from that, I don't have any other idead.

Kind regards,
Henning Krause

> Hi Henning,
>
[quoted text clipped - 40 lines]
>> >
>> > Drew Noakes.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.