Getting Mainform to load in background


Author
Message
Geoff Hirst
Geoff Hirst
StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)
Group: Forum Members
Posts: 123, Visits: 3.5K
Guys,

I hope I explain what I want to do correctly, forgive me if I don't. My app has a login form, and I would like the mainform to be loading in the background whilst the login form is present on the screen. Once a correct login is achieved, then the loading process to continue and display the main form.

My main form is shown immediately after the login form, except it starts to load there and it has a lot going on. I just kind of wondered if you did anything flashy like this in your medical app.

thanks

Geoff.

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
I have posted a sample on how to create a threaded splash screen that does exactly what you want. At some point we plan on creating a template for both VB and C# to do this easily as this really is such as easy thing to implement once you know what to do. This sample is in C#, but it should get you going whatever the case may be. Hope this helps! Smile
Attachments
ThreadedSplashScreenSample.zip (202 views, 1.00 MB)
Geoff Hirst
Geoff Hirst
StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)
Group: Forum Members
Posts: 123, Visits: 3.5K
Hi Trent,

Thanks for this, indeed the process isn't too complex. What was giving me the headaches really was the fact that my splashscreen is also my login screen, so I needed the application to kind of pause until a valid login was provided. What I did was invoke my splash-login using the normal SF methods, then invoke a new version of the form using your example but one that was reduced in size, hiding the login details, but displaying label message so the updates could be seen.

This works really well thanks for the assistance.

regards

Geoff Hirst

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Glad to help Smile
Jeff Pagley
Jeff Pagley
StrataFrame User (465 reputation)StrataFrame User (465 reputation)StrataFrame User (465 reputation)StrataFrame User (465 reputation)StrataFrame User (465 reputation)StrataFrame User (465 reputation)StrataFrame User (465 reputation)StrataFrame User (465 reputation)StrataFrame User (465 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
Hi Trent,

I converted your splash screen example to VB.NET and got it working and added to my program.  However, I ran into a very strange bug.  If I use the splash screen when starting the application, the images in my list view boxes do not show up.  Obviously, if I don't use it, they show up fine.  Do you have any idea what is going on?

Thanks,

Jeff

Jeff Pagley
Jeff Pagley
StrataFrame User (465 reputation)StrataFrame User (465 reputation)StrataFrame User (465 reputation)StrataFrame User (465 reputation)StrataFrame User (465 reputation)StrataFrame User (465 reputation)StrataFrame User (465 reputation)StrataFrame User (465 reputation)StrataFrame User (465 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
Hi Trent,

I did some more testing and I found out couple of things that might be causing the strange behavior. It seems to occur only with a frameless form as with a splash screen when running the app in Debug mode in the IDE.  And the behavior seems to be somewhat sporadic when I play with the StartPosition property of the window.  It seems to run fine in the release version.  Please don't waste much time on this unless you know what is happenning.

Thanks,

Jeff

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Nothing is coming immediately to mind here, but the whole purpose of the splash screen is to run threaded. So it sounds like there could be a treading issue within your configuration.
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Trent,



Thanks a lot for this sample. Since it is in C# I took the liberty to manually translate it to VB and it was a good learning experience, specially with the VB equivalent function for the C# Lock.



I simply added a VB project to the current solution and some copy/paste BigGrin.



Enjoy!



P.S.

To save some space you may want to remove your zip above since mine have the C# as you posted plus the VB.

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Thanks Edhy! Smile
Russell Scott Brown
Russell Scott Brown
StrataFrame User (278 reputation)StrataFrame User (278 reputation)StrataFrame User (278 reputation)StrataFrame User (278 reputation)StrataFrame User (278 reputation)StrataFrame User (278 reputation)StrataFrame User (278 reputation)StrataFrame User (278 reputation)StrataFrame User (278 reputation)
Group: Forum Members
Posts: 124, Visits: 597
Yeah, Thanks Edhy.

Russ Brown (Using C#2010/SQL Server 2008)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search