-
Form Loading..
Code:
If LoadData() = True Then
Call LoadSettings()
Call GetSettings()
If psteBUS_IsClosed = True Then
Dim frmSCR As New frmScreen
frmSCR.ShowDialog()
frmSCR.Dispose()
Else
Dim frmST As New frmStart
Dim frmLG As New frmLogin
frmST.ShowDialog()
frmLG.ShowDialog()
frmST.Dispose()
frmLG.Dispose()
end if
MainMenu.ShowDialog()
End If
Here is my code.. My forms is a little bit slow in showing, how can i make it a little bit faster..
MainMenu takes about 5-10 sec to load and the Mobile Screen display the default mobile screen it just look like the application has already ended. is it possible to display mainmenu the time the last form was disposed..
-
Re: Form Loading..
Hey rothj0hn,
I don't see any code. Did you forget an attachment?
How slow are we talking about?
Gary
-
Re: Form Loading..
-
Re: Form Loading..
Hey,
Can you provide some details as to what exactly is going on with each of those forms?
Creating and disposing of forms in the compact framework is quite an intensive process. Some people argue that it is better to create one form, with a number of panels. Then where you would create a new form, you simply move the panel into view.
Depending on what exactly you are trying to do, this may or may not be an option.
Gary
-
Re: Form Loading..
I agree with using 1 form and multiple panels. But sad to say that this application is already designed with multiple forms. So it will took burden of modification if i change the way it was designed just to solve that problem.
Anyway.. The problem only exist whenever i load the mainmenu, maybe because there are lots of controls on it. The other forms that was just bean created and disposed are just for splash screen and user login. I just wonder if is there a way that load the mainmenu set it as hidden then ill just show it on to avoid delay.
-
Re: Form Loading..
When you say MainMenu, are you talking about a form? To me, MainMenu would suggest a menu with different options the user can choose, i.e. File, Edit etc.
Are there any long running processes happening on this forms load event? Have you tried tracing the application to find out what is taking a long time?
Gary
-
Re: Form Loading..
MainMenu as MainForm.. Sorry for the Confusion. Yes it loads bunch of buttons that is generated during run time (classButtons), i think it causes the delay.
-
Re: Form Loading..
Hey,
As a verification of this, can you start taking portions of code out, or at least, put some log statements into various parts of the executing code? That will let you isolate what exactly is taking a long time to complete, and from there, you/we can start suggesting a method for improving this.
Gary
-
Re: Form Loading..
Hi,
may be worth using the excellent Eqatec profiler
Otherwise strap some timings around the code you suspect to be slow. Creating a form is known to be slow, as it takes loads of resources.
If it is your first form that is slow, consider a 'splash' form.
-
Re: Form Loading..
Hey Pete,
That looks like quite a nice application, and I am surprised that it is free!?!
In the past, I have always been pointed at:
http://memprofiler.com/
or:
http://www.red-gate.com/products/ant...iler/index.htm
Both of which cost quite a bit of money. Have you ever used either of these? How do they compare to EQATEC?
Thanks
Gary
-
Re: Form Loading..
Eqatec is the mutts nuts - designed to work with CF - which most other tools don't.
I know it started as a free tool but possibly may cost money now - depending on options.
-
Re: Form Loading..
Hey,
Nice expression :)
I have had a quick read, and from what I can see, the free version is just that, completely free. There is a commercial version, if you are going to be using it in a work environment.
Think I am going to check this out at the weekend.
Thanks
Gary