Click here to Skip to main content
12,998,892 members (70,445 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


11 bookmarked
Posted 30 Jan 2014

Popup in WPF

, 30 Jan 2014
Rate this:
Please Sign up or sign in to vote.
Use of popup of WPF to use as a selection menu


This tip is about the use of popup of WPF to use as a selection menu. Here is the code snippet to have a look at.

Using the Code

The code should be set as style "Formatted" like this:

<Button x:Name="generatebtn" Content="Generate" 

Height="25" Margin="10" Width="60" Click="generatebtn_Click" />

            <Popup x:Name="popup" IsOpen="False" 

            PlacementTarget="{Binding ElementName=selFilesbtn}" 

            Placement="Top" Width="146">
                <Border BorderBrush="Black" BorderThickness="1" 

                    <StackPanel Orientation="Horizontal">
                        <Grid Width="142">
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto" />

                            <GroupBox Header="Review As" 

                            HorizontalAlignment="Left" VerticalAlignment="Top" 

                                    <RadioButton x:Name="currentSelectionBtn" 

                                    <RadioButton x:Name="singleFileBtn" 

                                    Content="As Single File"/>
                            <Button x:Name="generateAsBtn" Content="Generate" 

                            Grid.Row="1" Click="generateAsBtn_Click" />

Here is the image of how the popup will appear.

Now after using this code snippet, the output will look like the image shown. In this code snippet, the image is aligned to the button on which the popup menu is made visible.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170622.1 | Last Updated 30 Jan 2014
Article Copyright 2014 by Nivedita Parihar
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid