I have a winforms test application I have created that consists of one form that contains 3 UltraLabels, 1 UltraTextEditor, 1 UltraComboEditor and 2 UltraButtons. After creating the form, dragging the components mentioned above onto the form and building, I tried starting the app (there is no other code in the constructor). The form popped up in about .5 of a second. Then I created a .isl file for app styling saved the file and loaded the file using the following code:
Infragistics.Win.AppStyling.StyleManager.Load("TestStyleSet.isl", False)
The startup time went from .5 of a second to 2 seconds. So I did another test to see if it was just AppStyling that was the culprit and created an empty StyleSet and it still took 2 seconds to start this simple app. So then I decided I would not use app styling but rather style the controls I had put on the form individually. I proceeded to set the UltraTextEditor's DisplayStyle as Office2007 with this line of code in the constructor:
UltraTextEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2007
and tried starting the app again. The app took 1.6 seconds to start this time. I then removed the above line of code from the constructor (no code is in the constructor now) and I was back to .5 of a second for startup time.
Is there a reason using appStyling or setting the DisplayStyle of an UltraTextEditor should affect the startup time of an application so significantly? Is there a workaround for either of these scenarios?
Thanks,
Daren
Hi Daren,
I can't see any reason why either of these things would so significantly slow down the application.
In what event did you load your isl file?
In what event did you set the DisplayStyle? What if you set the DisplayStyle at design-time rather than at run-time?
How exactly are you measuring the time it takes the form to load? My only guess here is that the form takes the same amount of time to load and paint, but if you are only measuring the load time, then calling into AppStylist or setting the DisplayStyle is simply forcing the assemblies to get loaded into memory earlier and thus affecting your timer, but not really slowing down the application. In other words, the assemblies have to be loaded at some point, and you are simply forcing them to load earlier and so they are being counted by whatever timer you are using, as opposed to later when the controls are painted for the first time.
But this seems pretty unlikely.
MIke,
Both the setting of the AppStyling and DisplayStyle were done in the constructor. I did try setting the DispalyStyle at design-time but I got the same result (slow).
As far as my timer goes, I simply timed it with Trace.WriteLine statements. I'll show you what I did:
Public Sub New()
Trace.WriteLine("Start " & Date.Now.ToString("MM/dd/yyyy HH:mm:ss:fff"))
' This call is required by the Windows Form Designer.
InitializeComponent()
Infragistics.Win.AppStyling.StyleManager.Load("TestStyleSet2.isl", False)
End Sub
Private Sub Form2_Shown(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Shown
Trace.WriteLine("End " & Date.Now.ToString("MM/dd/yyyy HH:mm:ss:fff"))
I believe the behavior is highly reproducible. All you'd need to do is create a winforms app, drop an UltraTextEditor on it and test the startup time. Then change the DisplayStyle to Office2007 and start the app again and you should see a significant difference in speed.