Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8875623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:01:10+00:00 2026-06-14T19:01:10+00:00

I want a popup to appear every time I hover a togglebutton. It then

  • 0

I want a popup to appear every time I hover a togglebutton. It then needs to stay open until I click somewhere else in the application. The code below works fine on start up but as soon as I check or uncheck the togglebutton the popup refuses to appear. Any ideas on what I’m doing wrong?

The WPF code

        <ToggleButton Name="btnLogFile" Style="{StaticResource StandardToggle}"
                      Grid.Row="1" Grid.Column="3" Margin="0,3,3,0" 
                      MouseEnter="btnLogFile_MouseEnter">
            <Path Margin="7" SnapsToDevicePixels="True" Stretch="Uniform"
                Stroke="{StaticResource TextLight}" StrokeThickness="2">
                <Path.Data>
                    <GeometryGroup FillRule="Nonzero">
                        <PathGeometry Figures="M 0 0 L 20 0 L 20 10 L 30 10 L 30 40 L 0 40 Z" />
                        <PathGeometry Figures="M 20 0 L 22 0 L 30 8 L 30 10" />
                    </GeometryGroup>
                </Path.Data>
            </Path>
        </ToggleButton>
        <Popup Name="popLogFile"
               PlacementTarget="{Binding ElementName=btnLogFile}" Placement="Custom"
               HorizontalOffset="0" VerticalOffset="0"
               MouseLeftButtonDown="popLogFile_MouseLeftButtonDown">
            <Border Background="{StaticResource BackgroundDark}" BorderBrush="{StaticResource TextBoxBorder}" BorderThickness="1"
                    Width="300" Height="Auto">
                <Grid Margin="3">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="3" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="3" />
                        <ColumnDefinition Width="22" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="22" />
                    </Grid.RowDefinitions>

                    <TextBlock Margin="0,1" Grid.Row="0" Grid.Column="0" Foreground="{StaticResource TextLight}" HorizontalAlignment="Right">Directory</TextBlock>
                    <TextBox Name="logfilePath" Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="3"
                             Style="{StaticResource StandardTextBox}"
                             Foreground="{StaticResource TextLight}">
                        C:\logfile.txt
                    </TextBox><!-- Button made invisible for the time being -->
                    <Button Name="btnBrowseLogfile" Style="{StaticResource StandardButton}" Grid.Row="0" Grid.Column="4" Visibility="Collapsed">...</Button>

                </Grid>
            </Border>
        </Popup>

And the togglebutton’s mouse event:

    private void btnLogFile_MouseEnter(object sender, MouseEventArgs e)
    {
        this.popLogFile.IsOpen = true;
        this.popLogFile.StaysOpen = false;
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T19:01:11+00:00Added an answer on June 14, 2026 at 7:01 pm

    1) Add event triggers to ToggleButton:

           <ToggleButton Name="btnLogFile" 
                      Style="{StaticResource StandardToggle}"
                      Grid.Row="1" Grid.Column="3" Margin="0,3,3,0" >
            <ToggleButton.Triggers>
                <EventTrigger RoutedEvent="MouseEnter">
                    <BeginStoryboard>
                        <Storyboard TargetName="popLogFile" TargetProperty="IsOpen">
                            <BooleanAnimationUsingKeyFrames  FillBehavior="HoldEnd">
                                <DiscreteBooleanKeyFrame
                        KeyTime="00:00:00"
                        Value="True" />
                            </BooleanAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
    
                <EventTrigger RoutedEvent="ToggleButton.Checked">
                    <BeginStoryboard>
                        <Storyboard TargetName="popLogFile" TargetProperty="IsOpen">
                            <BooleanAnimationUsingKeyFrames  FillBehavior="HoldEnd">
                                <DiscreteBooleanKeyFrame
                        KeyTime="00:00:00"
                        Value="False" />
                            </BooleanAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
    
                <EventTrigger RoutedEvent="ToggleButton.Unchecked">
                    <BeginStoryboard>
                        <Storyboard TargetName="popLogFile" TargetProperty="IsOpen">
                            <BooleanAnimationUsingKeyFrames  FillBehavior="HoldEnd">
                                <DiscreteBooleanKeyFrame
                        KeyTime="00:00:00"
                        Value="False" />
                            </BooleanAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
    
            </ToggleButton.Triggers>
    
            <Path Margin="7" SnapsToDevicePixels="True" Stretch="Uniform"
            ...
    

    2) Set in XAML StaysOpen=”False” :

    <Popup Name="popLogFile"
               PlacementTarget="{Binding ElementName=btnLogFile}" Placement="Custom"
               HorizontalOffset="0" VerticalOffset="0"
               StaysOpen="False"
               MouseLeftButtonDown="popLogFile_MouseLeftButtonDown">
    

    3) Remove method btnLogFile_MouseEnter

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When click a button,I want to popup a view form bottom,like this! Any help
I want to show popup box on a right-click at JTree node only, not
I have sales application. When the user click on EditText the popup calculator want
I want the link to appear in the tab beneath resulting in the popup
I have a simple user control which I want to create dynamically every time
I want the popup ad to appear once only for any visitor no matter
I simply want to popup an Alertbox in AS3. I am using Flashdevelop and
I have a TextBox and a Popup control. I want the Popup.IsOpen property to
I want to show Popup window contain YouTube video. My question is how to
I need a jquery slideshow with div popup i want to show my image

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.