transparent-control

WPF: Ignore mouse clicks on overlay/adorner, but handle MouseEnter event

拟墨画扇 提交于 2019-12-09 07:51:45
问题 What I really want is a version of IsHitTestVisible that ignores mouse click events but still traps mouse enter and leave events. Background: An informational overlay pops up under the control with focus whenever. This is a requirement, so I'm not at liberty to remove this behavior. This is implemented using an adorner containing a Rectangle shape, filled with an image brush. All controls are created programatically, no XAML involved. Desired behavior: When user mouses over the Rectangle, it

How to create a transparent control which works when on top of other controls?

旧街凉风 提交于 2019-11-27 13:35:59
I have a control (derived from System.Windows.Forms.Control) which needs to be transparent in some areas. I have implemented this by using SetStyle(): public TransparentControl() { SetStyle(ControlStyles.SupportsTransparentBackColor, true); this.BackColor = Color.Transparent. } Now, this works if there are no controls between the form and the transparent control. However, if there happens to be another control below the transparent control (which is the use case here), it does not work. The intermediate control is not draw, but the form below does show through. I can get the effect that I need

How to create a transparent control which works when on top of other controls?

喜夏-厌秋 提交于 2019-11-26 16:25:06
问题 I have a control (derived from System.Windows.Forms.Control) which needs to be transparent in some areas. I have implemented this by using SetStyle(): public TransparentControl() { SetStyle(ControlStyles.SupportsTransparentBackColor, true); this.BackColor = Color.Transparent. } Now, this works if there are no controls between the form and the transparent control. However, if there happens to be another control below the transparent control (which is the use case here), it does not work. The