winforms - Can I use a .net control parent class to enable/disable it? -


I have to write a representative for a multi-threaded program that will enable / disable different controls. It seems logical that using a handler for all controllers would be the best option, but I am also not sure whether it is possible. NET and if so, how to implement it.

  public zeros setControlsEnabled (bool enabled) {// Make sure we are in the right thread If (InvokeRequired) {// If not, call the method run on the UI thread (new way increment (() => set controls enabled (enabled)); Return; } // Keep all the control codes here, for example: // control1.Enabled = enabled; // control2.Enabled = enabled; // Alternatively, a foreach (in Control C control) {...}}  

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -