Changeset 16501


Ignore:
Timestamp:
01/05/19 10:07:02 (2 weeks ago)
Author:
gkronber
Message:

#2978: added SuspendRepaint and ResumeRepaint calls in ProgressView before and after Control.Enabled = ...
and removed unused code.

Location:
trunk/HeuristicLab.MainForm.WindowsForms/3.3/Controls
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ControlExtensions.cs

    r15583 r16501  
    4646      }
    4747    }
    48 
    49     public static IEnumerable<Control> GetNestedControls(this Control control, Func<Control, bool> condition = null) {
    50       if (control == null) yield break;
    51       if (condition == null) condition = (c) => true;
    52 
    53       Queue<Control> unprocessed = new Queue<Control>();
    54       unprocessed.Enqueue(control);
    55 
    56       while (unprocessed.Count > 0) {
    57         Control c = unprocessed.Dequeue();
    58         if (condition(c)) yield return c;
    59         foreach (Control child in c.Controls)
    60           unprocessed.Enqueue(child);
    61       }
    62     }
    6348  }
    6449}
  • trunk/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ProgressView.cs

    r16430 r16501  
    114114      UpdateButtonsState();
    115115
     116      Control.SuspendRepaint();
    116117      Control.Enabled = false;
    117118      Parent = Control.Parent;
    118119      BringToFront();
     120      Control.ResumeRepaint(true);
    119121      Visible = true;
    120122    }
     
    128130
    129131      Visible = false;
     132      Control.SuspendRepaint();
    130133      Control.Enabled = true;
     134      Control.ResumeRepaint(true);
    131135      Parent = null;
    132136    }
Note: See TracChangeset for help on using the changeset viewer.