Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Detect when Parent becomes disabled

$
0
0

I have a C# control (a subclass of ComboBox, if it matters) that is normally in OwnerDraw mode, but switches to Normal DrawMode when disabled.  The problem is that this switch doesn't occur when its parent GroupBox or Panel gets disabled - my control stays in OwnerDraw mode regardless of the Enabled state of its parent. Its OnEnabledChanged and OnDrawItem events never get called when the parent is disabled. If at all possible, I'd really prefer to avoid subclassing to solve this problem. Would it be possible to get my control to detect when its parent control becomes disabled, or else to extend GroupBox and Panel so that they inform their children when they are disabled?


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>