ARTICLE

Expander in WPF

Posted by Sapna Articles | WPF using VB.NET August 31, 2010
In this article you will learn how to create a Expander in WPF.
 
Reader Level:

Expander has extra facility to expand content as compare to GroupBox. Expander wraps a region of content and By clicking a small arrow button user can show or hide the content. The IsExpanded property determines if the panel is expanded or not. ExpandDirection is used to make the content expanded behaviour. You can use the four Directions, Down, Up, Right and Left to change the Expanded direction of the content. Expander is frequently used in online help and on web pages to include large amounts of content without overwhelming users with information they don't want to see.

Example of GroupBox

<
Window x:Class="MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width
="525">
    <StackPanel>
        <Expander Margin="5" Padding="5" Header="Form 1">
            <Button Padding="3">Click to open form 1</Button>
        </Expander>
 
       <Expander Margin="5" Padding="5" Header="Form 2" >
            <TextBlock TextWrapping="Wrap">
Sorry for inconvience, form is under process...
           
</TextBlock>
        </Expander>
        <Expander Margin="5" Padding="5" Header="Form 3">
            <Button Padding="3">Click to open form 3</Button>
        </Expander>
        <Expander Margin="5" Padding="5" Header="Form 4">
            <Button Padding="3">Click to open form 4</Button>
        </Expander>
    </StackPanel>
</
Window>

OUTPUT

expender.gif

CONCLUSION

Hope this article help you to understand about Expander in WPF.

Login to add your contents and source code to this article
share this article :
post comment
 
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
    Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Team Foundation Server Hosting
Become a Sponsor