Currently, I have most form controls disabled at startup because you cannot use them until the file is uploaded. However, after loading the file, the controls must be enabled.
I used bindings, but I don't think they are a good solution. Firstly, it’s unnecessary complexity. Secondly, you cannot use bindings for everything. For example, MenuStrip items cannot have their Enabled object attached to the fileLoaded property. Only all menus can and I don’t want to disable all menus at startup, only certain menu operations that work with the file.
I am really looking for a way to include EVERYTHING. Most, when asked, will answer with this:
foreach (Control c in Controls)
{
c.Enabled = true;
}
However, this does not work to include MenuStrip elements or controls in other controls (such as a panel or user control). Therefore, it would not include scrollbars in containers.
I suppose I could use this line and manually include everything else, but I could always just include everything manually. I am looking for a way to automatically enable everything.
source
share