Winform rendering pretty slow


Author
Message
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi,

I am working on my first SF application, and testing outside the VS debugger, I noticed some slowness on the winforms when loading.

I prepared a small sample video so you can see what I mean.

http://www.progytech.com/videos/SF_Sample.html

Please let me know if there is any settings I need to do in order to adjust this unwanted effect.

The computer where this is being test is running Vista 64bits with 8gb ram.

Edhy Rijo

Replies
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Trent L. Taylor (04/15/2008)
This at least gives you more control than just setting the IsMDIContainer proeprty to True and then you can start to create your application environment.

Trent,

You certainly nailed the problem with this sample solution.  In no time I was able to replace the old code in my Main Form and now the rendering problem is virtually gone.

I took the liberty of adding some functionality to the LaunchForm method that will do the following:

  1. Before creating a new form object, check through the _MDI form's collection for an existing instance.
  2. If found then activate that instance and bring it to the front.

Here is the changed code:

''' <summary>

''' Common method for automatically launching a form and making it an MDI child.

''' If the form exist in the _MDI collection then show it to the user instead.

''' This functionality could be controlled by passing a 2nd parameter

''' </summary>

''' <param name="FormType"></param>

''' <remarks></remarks>

Private Sub LaunchForm(ByVal FormType As System.Type)

     '-- Establish Locals

     Dim loForm As Form

     '-- Create the form

     loForm = CType(Activator.CreateInstance(FormType), Form)

     For Each currentForm As Form In Me._MDI.Controls

          If currentForm.Name = loForm.Name Then

               '-- If the form is minimized then restore it.

               If currentForm.WindowState = FormWindowState.Minimized Then

                    currentForm.WindowState = FormWindowState.Normal

               End If

               '-- Show the form on top of the others.

               currentForm.BringToFront()

               Exit Sub

          End If

     Next

     '-- Set the MDI parent

     loForm.MdiParent = Me

     '-- Show the form

     loForm.Show()

End Sub



Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Glad it helped you with your problem.  Smile
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Edhy Rijo - 17 Years Ago
Edhy Rijo - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Edhy Rijo - 17 Years Ago
Trent L. Taylor - 17 Years Ago
                         One other thing I thought about that can improve performance is to...
Trent L. Taylor - 17 Years Ago
                             OK...a final, final thought :D I am working from home today and on a...
Trent L. Taylor - 17 Years Ago
                                 Edhy, I was testing something in the CRM sample and noticed a similar...
Trent L. Taylor - 17 Years Ago
                                     Hi Trent, Sorry I could not get back to you earlier, I was out today...
Edhy Rijo - 17 Years Ago
                                         Edhy, I reproduced your problem through an MDI environment...
Trent L. Taylor - 17 Years Ago
                                             Hi Trent, Thanks again for the support. I tried your code in the CRM...
Edhy Rijo - 17 Years Ago
                                                 This is turning into somewhat of a lesson on windows, rendering, and...
Trent L. Taylor - 17 Years Ago
                                                     Thanks Trent, Will check your sample and implement in my current...
Edhy Rijo - 17 Years Ago
                                                     [quote][b]Trent L. Taylor (04/15/2008)[/b][hr]This at least gives you...
Edhy Rijo - 17 Years Ago
                                                         Glad it helped you with your problem. :)
Trent L. Taylor - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search