Disable Parent Panel, while keeping child panel enabled

后端 未结 2 1054
渐次进展
渐次进展 2020-12-20 15:10

I have a WinForms app, and I have a massive Panel in it. And inside that Panel is a bunch of stuff, including a second, tiny panel.

When a certain event occurs, I wa

相关标签:
2条回答
  • 2020-12-20 15:36

    No, this is not possible. All child controls are disabled when their parent is disabled. That's simply how Windows works; you're not going to be able to change it.

    You need to find a different way of solving your problem. Re-parenting the control is an option, but the way you're trying to do it is incorrect. You need to remove it from the Controls collection for the "massive Panel", and then add it to the Controls collection for your form. Then you will be able to change the enabled state of both controls independently.

    0 讨论(0)
  • 2020-12-20 15:36

    I don't think you can make a control enabled while the parent control is disabled.

    0 讨论(0)
提交回复
热议问题