ismouseover

WPF - TabItem MouseOver not working as intended

删除回忆录丶 提交于 2019-12-31 01:46:09
问题 I have an issue with the IsMouveOver trigger with a TabItem Element. When the mouse cursor is on a TabItem, its background color changes, which is what I want => It works. However the background color of the TabItem also changes whenever my mouse cursor is on an item inside the TabItem. Here's the XAML related to the styling: <Style x:Key="SupTest" TargetType="{x:Type TabItem}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type TabItem}"> <Border Margin="2" Name

Show “pop up window” when is mouser over listBox item

让人想犯罪 __ 提交于 2019-12-25 04:45:10
问题 I bind observable collection on listBox. I have data tempate on listbox item. It consit one image control and som textBlock. If is mouse over on some listBox item I would like achieve this behavior: Show PopUp/ToolTip (some "rectangle" with controls) and bind values from listBox current item. And on textBox in item data template I have style, I would like change color of text in textBlock, for example from black to green. Style is here: <Style x:Key="FriedNickStyle" TargetType="TextBlock">

Getting the Logical UIElement under the mouse in WPF

一笑奈何 提交于 2019-12-23 13:15:51
问题 It seems that all of the way of retrieving an element under the Mouse relates to Visual Hit testing. Is there some mechanism that I'm missing which would allow me to grab the actual UIElement that represents the current visual tree that the HitTest returns? Summary of what I'm doing: I have a custom tooltip class which relies on doing something based on the UIElement that the mouse is over. Simply put, it hooks into the owning Window's PreviewMouseMove event and updates a "current Item". This

IsMouseOver trigger doesn't work when using ShowDialog and borderless window

对着背影说爱祢 提交于 2019-12-20 10:24:53
问题 I have two Windows for an application. One of them is MainWindow and the other is for settings. SettingsWindow opens when settings button is clicked by using ShowDialog and setting its Owner to MainWindow . On the SettingsWindow I have a button at the very bottom of the window and it changes the color to red when IsMouseOver is True and blue for False . But it doesn't change when the cursor is over the MainWindow. The image is below to be clear. How can I fix this problem? CASE: The cursor is

Bring up ContextMenu when IsMouseOver on a Button using only XAML

佐手、 提交于 2019-12-11 11:02:04
问题 I am trying to use XAML (only, no codebehind) to bring up the ContextMenu of a button. I have this my button here <Button x:Name="btn" Style="{StaticResource mybutton}" > <Button.ContextMenu> <ContextMenu> <TextBlock Text="Information"/> </ContextMenu> </Button.ContextMenu> </Button> The Style for the button here <Style TargetType="{x:Type Button}" x:Key="mybutton"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Button}"> <ControlTemplate.Triggers> <Trigger

How to check if a mouse is over a control

久未见 提交于 2019-12-10 18:59:10
问题 How does one check if the mouse is over a certain HWND? I have tried using the WM_MOUSELEAVE and WM_MOUSEMOVE messages to keep track, but if you click a button and drag the mouse out of the button, it doesn't receive the WM_MOUSELEAVE until the mouse is released, which is too late, because: When you click a button, the WM_COMMAND message is only sent if: 1. The mouse was originally depressed over the button 2. The mouse is over the button 3. The mouse is released over the button I need to

Trigger for IsMouseOver on TabItem ContenTemplate

孤人 提交于 2019-12-08 02:08:09
问题 I have a problem with a TabItem Style and maybe someone of you can help me. Following the Style at issue: <Style x:Key="ChildrenTabItemStyle" TargetType="TabItem"> <Style.Resources> <SolidColorBrush x:Key="ButtonNormalBackground" Color="#FFEAE8E8"/> <LinearGradientBrush x:Key="ButtonOverBackground" EndPoint="0,1" StartPoint="0,0"> <GradientStop Color="#FFFAFAFA" Offset="0"/> <GradientStop Color="#FFE0E0E3" Offset="1"/> </LinearGradientBrush> <LinearGradientBrush x:Key="ButtonPressedBackground

Trigger for IsMouseOver on TabItem ContenTemplate

本小妞迷上赌 提交于 2019-12-06 06:16:52
I have a problem with a TabItem Style and maybe someone of you can help me. Following the Style at issue: <Style x:Key="ChildrenTabItemStyle" TargetType="TabItem"> <Style.Resources> <SolidColorBrush x:Key="ButtonNormalBackground" Color="#FFEAE8E8"/> <LinearGradientBrush x:Key="ButtonOverBackground" EndPoint="0,1" StartPoint="0,0"> <GradientStop Color="#FFFAFAFA" Offset="0"/> <GradientStop Color="#FFE0E0E3" Offset="1"/> </LinearGradientBrush> <LinearGradientBrush x:Key="ButtonPressedBackground" EndPoint="0,1" StartPoint="0,0"> <GradientStop Color="#FFE0E0E2" Offset="0"/> <GradientStop Color="