xaml - how do i make that dang wpf popup go away? -


When I use a popup, it seems to hang around, in the code given below I override a template By applying a popup to a text box, and when the focus is on the text box, a popup is displayed. When you remove popups on the next tab of the screen element, but if you only alt-tab another application, the popup in the foreground stays how do I get rid of it?

  & lt; Window x: class = "dropdown picture. Window 1" xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" Xmlns: x = "http://schemas.microsoft.com/winfx/ 2006 / xaml "title =" window 1 "height =" 300 "width =" 300 "& gt; & Lt; Grid & gt; & Lt; StackPanel & gt; & Lt; Text box text = "hello" & gt; & Lt; TextBox.Style & gt; & Lt ;! - Simple Text Box - & gt; & Lt; Style TargetType = "{x: type text box}" & gt; & Lt; Setter Property = "KeyboardNavigation.TabNavigation" Value = "None" /> & Lt; Setter Property = "FocusVijual Style" Value = "{x: Faucet}" /> & Lt; Setter property = "allow" value = "true" /> & Lt; Setter Estates = "Template" & gt; & Lt; Setter.Value & gt; & Lt; ControlTemplate TargetType = "{x: type text box}" & gt; & Lt; Grid & gt; & Lt; Border x: name = "border" background = "{DynamicResource WindowBackgroundBrush}" BorderBrush = "{DynamicResource SolidBorderBrush}" range = "1" padding = "2" cornerreadia = "2" & gt; & Lt; Grid & gt; & Lt ;! - Imposes the implementation content in the ScrollViewer, it should be named PART_ContentHost for control - & gt; & Lt; ScrollViewer margin = "0" x: name = "PART_ContentHost" style = "{DynamicResource SimpleScrollViewer}" background = "{TemplateBinding background}" /> & Lt; Popup x: name = "The popup" isOpen = "False" & gt; & Lt; Border border = brushes = "red" border = "5" & gt; & Lt; Text block text = "Hellssss" /> & Lt; / Border & gt; & Lt; / Popup & gt; & Lt; / Grid & gt; & Lt; / Border & gt; & Lt; / Grid & gt; & Lt; ControlTemplate.Triggers & gt; & Lt; Trigger Property = "IFococled" Value = "True" & gt; & Lt; Setter TargetName = "The Popup" property = "isoption" value = "true" /> & Lt; / Catalyst & gt; & Lt; /ControlTemplate.Triggers> & Lt; / ControlTemplate & gt; & Lt; /Setter.Value> & Lt; / Setter & gt; & Lt; / Style & gt; & Lt; /TextBox.Style> & Lt; / Text box & gt; & Lt; Text box text = "ssss" /> & Lt; / StackPanel & gt; & Lt; / Grid & gt; & Lt; / Window & gt;    

Did you set StaysOpen property to false ?

If StaysOpen is True , which is the default, it will be open until the control is in focus if this is incorrect It will remain open until a mouse or keyboard event is outside of the popup control, which can happen when Alt-tabing is done. You may have to make some changes to make it a little bit to like, but it can be a starting point.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -