Solved

Need Help Speeding Load Time of Programmatically Created Controls in VB.NET PC Application

Posted on 2011-09-13
5
346 Views
Last Modified: 2012-05-12
Hello,

I am developing a VB PC application using Visual Studio 2008 and the .NET 3.5 Framework.

In debug mode, my code loads programmaticlly created controls very slowly, but this is OK.  The problem is that when I run in release mode, the system is no faster.

I'm wondering if there is some setting(s) I need to change for the release mode configuration (i.e., maybe release mode is accidentally configured like debug mode in one or more ways that need to be altered).

Any help would be most appreciated.

Thank you, Stu Engelman
0
Comment
Question by:stuengelman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 17

Expert Comment

by:nepaluz
ID: 36528521
Can you show us some code of how you create the controls? Unless you are creating hundreds of thousands, speed should not be an issue, rather memory usage should.
0
 

Author Comment

by:stuengelman
ID: 36528667
Hi Nepaluz,

In most cases I am loading multiple instances of progammatically instantiated User Controls.  The User Controls contain the native controls, such as text boxes, checkboxes, and buttons.  The typical User Control has about ten native controls.  The render speed is very slow, even if only 5-6 User Controls need to be rendered on my form.

Sample instantiation code is:

Dim dmxrow As New MXrow ' 'MXrow is the name of the User Control here
dmxrow.Name = "mxrow" & CStr(ii) 'ii is a counter
Me.Controls.Add(dmxrow)
dmxrow.Left = 40
dmxrow.Top = toplevel 'toplevel is serially updated so the controls are rendered vertically

Stu
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 36529254
Is there code that could be optimized in the UserControl constructor, Load event or VisibleChanged?

You also try to suspend the layout while loading your controls. This might help a bit:
Me.SuspendLayout()
'Load your controls
Me.ResumeLayout()
Me.PerformLayout()

Open in new window

0
 

Author Comment

by:stuengelman
ID: 36529446
James - FANTASTIC!  It's 100 times faster.

Thanks so much, Stu
0
 

Author Closing Comment

by:stuengelman
ID: 36529452
Great job, solution worked perfectly.
0

Featured Post

Raise the IQ of Your IT Alerts

From IT major incidents to manufacturing line slowdowns, every business process generates insights that need to reach the people required to take action. You need a platform that integrates with your business tools to create fully enabled DevOps toolchains.

You need xMatters.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question