StrataFrame Forum

Getting Mainform to load in background

http://forum.strataframe.net/Topic24530.aspx

By Geoff Hirst - 9/4/2009

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.

By Trent L. Taylor - 9/7/2009

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
By Geoff Hirst - 9/8/2009

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

By Trent L. Taylor - 9/8/2009

Glad to help Smile
By Jeff Pagley - 10/30/2009

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

By Jeff Pagley - 10/30/2009

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

By Trent L. Taylor - 10/30/2009

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.
By Edhy Rijo - 2/19/2010

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.
By Trent L. Taylor - 2/20/2010

Thanks Edhy! Smile
By Russell Scott Brown - 2/20/2010

Yeah, Thanks Edhy.
By Keith Chisarik - 2/20/2010

I miss sample code in VB.NET. Very much.

I find I have to convert everything manually (great for learning, bad for productivity) since the converters always get something wrong.

By Edhy Rijo - 2/20/2010

Keith Chisarik (02/20/2010)
I miss sample code in VB.NET. Very much.




Me too BigGrin, but every where I turn, I see more and more C# samples, books, articles than VB.NET, probably with VS2010 will be easier to start working with C# even though I do like VB a lot (humm, I never though I would say that, being a VFP developer for so many years w00t )
By Les Pinter - 2/21/2010

Hi all,

   TangibleSoftwareSolutions.com sells Instant C# and Instant VB, software to convert VB to C# and vice-versa. I've used it for years, even though I can write in both languages, and it does a remarkable job. VBConversions.net sells a slightly more expensive product, but Instant C# does a great job.

Les 

By Russell Scott Brown - 2/21/2010

I just looked and it is only $179 too for Instant C#

I also checked to see what Les uses to show code in both VB and C# on his website articles and noticed that he mentions Tangible Software Solutions on his website as well.  It must be good!Cool

Thanks

By Edhy Rijo - 2/21/2010

Thanks Les, will keep this info safe, for when I decide to jump into C# seriously.
By Trent L. Taylor - 2/22/2010

I miss sample code in VB.NET. Very much.



I find I have to convert everything manually (great for learning, bad for productivity) since the converters always get something wrong.




As Les and some of the other chimed in, Instant VB.NET is actually something that we use to convert projects over when we post them ourselves. This is a great tool to have around. That being said, though, I will try to be more in tune with this in the future. Smile