Blocked Up

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

A Windows Forms code snippet shows a verbose method for disabling UI controls across multiple panels and group boxes. Instead of simply setting the Enabled property on each container (which automatically propagates to child controls), the code manually iterates every child control and checks its type against five specific types using GetType() == typeof() rather than the is operator, with no else-if chaining. The post highlights two possible explanations: developer ignorance of WinForms inheritance, or an intentional (but poorly implemented) attempt to disable only certain control types while leaving others enabled.

4m read timeFrom thedailywtf.com
Post cover image
3K Impressions