title: Adjusting Button Visiblity with MouseOver
body: <p>I want to display a button only when the user puts the mouse over its location, once the mouse leaves the area, the button should go back to being Hidden.  Here is my code for the buttons.</p>
  
  <pre><code>&lt;StackPanel Name="ButtonOptions" Orientation="Horizontal" DockPanel.Dock="Bottom" Background="DarkBlue" Height="50" Width="auto"&gt;
      &lt;!--&lt;StackPanel.Resources&gt;
          &lt;Style TargetType="Button"&gt;
              &lt;Style.Triggers&gt;
                  &lt;Trigger Property="IsMouseOver" Value="True"&gt;
                      &lt;Setter Property="Visibility" Value="Visible"/&gt;
                  &lt;/Trigger&gt;
              &lt;/Style.Triggers&gt;
          &lt;/Style&gt;
      &lt;/StackPanel.Resources&gt;--&gt;
      &lt;Button Name="LoginButton" FontSize="12" Click="LoginButton_Click" Content="Log In" Width="100" Height="31" Margin="50,0,0,0" 
              FontFamily="Arial" Visibility="Visible" IsEnabled="True" MouseEnter="LoginButton_MouseEnter" /&gt;
      &lt;Button Name="OptionsButton" Content="Options" Width="100" Height="31" Margin="20,0,0,0" FontFamily="Arial"
              FontSize="12" Click="OptionsButton_Click" Visibility="Hidden" IsEnabled="False"/&gt;
  &lt;/StackPanel&gt;
  </code></pre>
  
  <p>The resouces section is commented out because I tried that and it wasn't working.  My log in button has the the following eventhandler attached..</p>
  
  <pre><code>LoginButton.MouseEnter += new MouseEventHandler(LoginButton_MouseEnter);
  </code></pre>
  
  <p>The method that handles this is..</p>
  
  <pre><code>private void LoginButton_MouseEnter(object sender, MouseEventArgs e)
  {
      MessageBox.Show("Made in the login button listener for mouseOver");
  
      LoginButton.Visibility = Visibility.Visible;
  }
  </code></pre>
  
  <p>When I run my app, nothing happens when I put over the location where the button should be.  However, if I set the log in button's visibility to be Visible initially, I can see the button, and when I click on it, my log in logic method for a users sign in is overridden, and I am prompted with the message box in the MouseEventListener method for "Made in the login button listener for mouseOver".  Not only that, but I receive two of these messages (as soon as I click "Ok" the first time, it immediately pops up again)  I am not sure why it doesn't work, nor why my click event method is ignored and NOW the mouseEvent method occurs.</p>
  
  <p>Any thoughts or help would be appreciated, thanks!</p>