Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>At first sight, I would take a look at the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.form.windowstate.aspx" rel="nofollow noreferrer"><code>Form.WindowsState</code></a> property, if you haven't already. I doubt that if you happen to set this property to <code>FormWindowState.Maximized</code> on design, this would be changed when setting their <code>Visible</code> property <code>true</code>/<code>false</code>.</p> <p>For the "[...] every child form gets redrawn in succession [...]"-thing, have you tried to use the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.control.suspendlayout.aspx" rel="nofollow noreferrer"><code>SuspendLayout()</code></a> method on the beginning of the active user's forms verification, and calling <a href="http://msdn.microsoft.com/en-us/library/y53zat12.aspx" rel="nofollow noreferrer"><code>ResumeLayout()</code></a> afterwards?</p> <p><strong>EDIT #1</strong></p> <ul> <li>I would advise you to load only the required <code>Form</code> for the current user.</li> </ul> <blockquote> <p>Doing so will reduce the amount of memory used by your application, plus, it shall reduce considerably the number of forms contained within the <code>MdiChildren</code> collection property. Then, iterating through the collection, if still required, will be faster.</p> </blockquote> <p>If this isn't an option for you, then perhaps using <strong>Linq</strong> might help:</p> <pre><code>var visibleForms = from f in MdiChildren where (((OfficeFormEx)f).UserID == (int)e.NewTab.Tag) select f; var invisibleForms = from f in MdiChildren where (((OfficeFormEx)f).UserID != (int)e.NewTab.Tag) select f visibleForms.ToList().ForEach(f =&gt; f.Visible = true); invisibleForms.ToList().ForEach(f =&gt; f.Visible = false); </code></pre> <p><em>If you're using .NET 4.0, perhaps would this be a good candidate for <a href="http://msdn.microsoft.com/en-us/magazine/cc163329.aspx" rel="nofollow noreferrer"><strong><code>PLINQ</code></em></strong></a></p> <p>Please provide feedback so that we can come to a solution. =)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload