467,118 Members | 907 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,118 developers. It's quick & easy.

load form in vb.net

I've got tthree forms at start up
splashscreen- works fine however how do i set the time delay so it stays on
the window longer,, shows longer??
Loginscreen- works fine, after the data processing of username etc is done I
then need to load, call whatever the syntax is the mainForm at the end of the
loginscreen..????? how is that done so it starts at the mainForm_Load
procedure??? As it stands now the mainform loads but just for a split
second??>>

MItch
Oct 15 '06 #1
  • viewed: 7176
Share:
8 Replies
I had a simillar issue.

I had a "main form", "a spash screen", and a "login form".

I main my #1 form in vb to be the "Main Form.

On the OnLoad of the Main form, I call the splash screen.

The splash screen will show even before the main form paints.

Now, if you want the login form to show after the main form is painted, the
only way I have solved this by putting the login.show somewhere, is kinda
silly but it works. I added a timer to the main form, and put a 1/2 second
timer delay on it.
When the timer fires, i timer.enabled = false, and i show my login form.

I realy couldnt figure out where to put the login form call so my main form
displays and then the login on top.

Miro
"Mitch5713" <mi***@nnex.netwrote in message
news:F9**********************************@microsof t.com...
I've got tthree forms at start up
splashscreen- works fine however how do i set the time delay so it stays
on
the window longer,, shows longer??
Loginscreen- works fine, after the data processing of username etc is done
I
then need to load, call whatever the syntax is the mainForm at the end of
the
loginscreen..????? how is that done so it starts at the mainForm_Load
procedure??? As it stands now the mainform loads but just for a split
second??>>

MItch

Oct 15 '06 #2
Miro,

You can use in this case in your load form method a login form that you call
with ShowDialog, if you use it like this than the mainform is not even
showed.

If myLoginForm.ShowDialog <Dialogresult.OK then
messagebox.show("your login was wrong")
me.close
End if

I hope this helps,

Cor

"Miro" <mi******@golden.netschreef in bericht
news:e4**************@TK2MSFTNGP02.phx.gbl...
>I had a simillar issue.

I had a "main form", "a spash screen", and a "login form".

I main my #1 form in vb to be the "Main Form.

On the OnLoad of the Main form, I call the splash screen.

The splash screen will show even before the main form paints.

Now, if you want the login form to show after the main form is painted,
the only way I have solved this by putting the login.show somewhere, is
kinda silly but it works. I added a timer to the main form, and put a 1/2
second timer delay on it.
When the timer fires, i timer.enabled = false, and i show my login form.

I realy couldnt figure out where to put the login form call so my main
form displays and then the login on top.

Miro
"Mitch5713" <mi***@nnex.netwrote in message
news:F9**********************************@microsof t.com...
>I've got tthree forms at start up
splashscreen- works fine however how do i set the time delay so it stays
on
the window longer,, shows longer??
Loginscreen- works fine, after the data processing of username etc is
done I
then need to load, call whatever the syntax is the mainForm at the end of
the
loginscreen..????? how is that done so it starts at the mainForm_Load
procedure??? As it stands now the mainform loads but just for a split
second??>>

MItch


Oct 15 '06 #3
OK but here is my problem I have the login form as my main for,, that way the
splash scrren starts then it goes to the login form i dont want the useres to
see the main form until login is sucessful??? How do i call the main form
from the end of the login form????????

"Miro" wrote:
I had a simillar issue.

I had a "main form", "a spash screen", and a "login form".

I main my #1 form in vb to be the "Main Form.

On the OnLoad of the Main form, I call the splash screen.

The splash screen will show even before the main form paints.

Now, if you want the login form to show after the main form is painted, the
only way I have solved this by putting the login.show somewhere, is kinda
silly but it works. I added a timer to the main form, and put a 1/2 second
timer delay on it.
When the timer fires, i timer.enabled = false, and i show my login form.

I realy couldnt figure out where to put the login form call so my main form
displays and then the login on top.

Miro
"Mitch5713" <mi***@nnex.netwrote in message
news:F9**********************************@microsof t.com...
I've got tthree forms at start up
splashscreen- works fine however how do i set the time delay so it stays
on
the window longer,, shows longer??
Loginscreen- works fine, after the data processing of username etc is done
I
then need to load, call whatever the syntax is the mainForm at the end of
the
loginscreen..????? how is that done so it starts at the mainForm_Load
procedure??? As it stands now the mainform loads but just for a split
second??>>

MItch


Oct 15 '06 #4
I'm going to recommend that you avoid starting an app by running a form.
There is no upside to doing this and you're experiencing the downside. :-)

Declare a PUBLIC Sub Main() and have that be the starting point. Then you
have complete control of what happens and when.

Public Shared Sub Main(ByVal args() as String)

' show the splash screen
' load the user settings initialize stuff
' hide the splash screen

' if everything is okay so far

' show the login dialog
' if the login is successful
' run the main form
' end if

' end if

You have a chance to get the command line arguments (if there are any) and
you can display and hide the splash screen at will. You also have the user
settings prior to anything much else happening which might contain settings
for screen positions, colors, sounds, server name, etc. And the main screen
isn't loaded until the login is successful.

Re: your splash screen timing. I wrote a SplashScreen class that does it
all for me but basically you set the "minimum" time you want it to display
as you display it. There is no reason to set up any kind of timer at that
point but you do make note of the time it was displayed. When you go to
close the splash screen the routine first checks to see if the
initialization took longer than the minimum time (check the time now against
the time you saved). If it is over the minimum it goes ahead and closes the
screen if it is less than the minimum it goes to sleep for the remaining
amount of time and then closes it.

Hope this helps,
Tom
"Mitch5713" <mi***@nnex.netwrote in message
news:F9**********************************@microsof t.com...
I've got tthree forms at start up
splashscreen- works fine however how do i set the time delay so it stays
on
the window longer,, shows longer??
Loginscreen- works fine, after the data processing of username etc is done
I
then need to load, call whatever the syntax is the mainForm at the end of
the
loginscreen..????? how is that done so it starts at the mainForm_Load
procedure??? As it stands now the mainform loads but just for a split
second??>>

MItch

Oct 15 '06 #5
I think the only way u can do this than, is that you will need to create an
"invisible form as ur main form, and do it that way.

Miro

"Mitch5713" <mi***@nnex.netwrote in message
news:82**********************************@microsof t.com...
OK but here is my problem I have the login form as my main for,, that way
the
splash scrren starts then it goes to the login form i dont want the useres
to
see the main form until login is sucessful??? How do i call the main form
from the end of the login form????????

"Miro" wrote:
>I had a simillar issue.

I had a "main form", "a spash screen", and a "login form".

I main my #1 form in vb to be the "Main Form.

On the OnLoad of the Main form, I call the splash screen.

The splash screen will show even before the main form paints.

Now, if you want the login form to show after the main form is painted,
the
only way I have solved this by putting the login.show somewhere, is kinda
silly but it works. I added a timer to the main form, and put a 1/2
second
timer delay on it.
When the timer fires, i timer.enabled = false, and i show my login form.

I realy couldnt figure out where to put the login form call so my main
form
displays and then the login on top.

Miro
"Mitch5713" <mi***@nnex.netwrote in message
news:F9**********************************@microso ft.com...
I've got tthree forms at start up
splashscreen- works fine however how do i set the time delay so it
stays
on
the window longer,, shows longer??
Loginscreen- works fine, after the data processing of username etc is
done
I
then need to load, call whatever the syntax is the mainForm at the end
of
the
loginscreen..????? how is that done so it starts at the mainForm_Load
procedure??? As it stands now the mainform loads but just for a split
second??>>

MItch



Oct 15 '06 #6
Yes in my case however I wanted to show the main form.

So I needed to use the timer to display it 1/2 second after the main form.
-Unless there is another way?

M.
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:es****************@TK2MSFTNGP02.phx.gbl...
Miro,

You can use in this case in your load form method a login form that you
call with ShowDialog, if you use it like this than the mainform is not
even showed.

If myLoginForm.ShowDialog <Dialogresult.OK then
messagebox.show("your login was wrong")
me.close
End if

I hope this helps,

Cor

"Miro" <mi******@golden.netschreef in bericht
news:e4**************@TK2MSFTNGP02.phx.gbl...
>>I had a simillar issue.

I had a "main form", "a spash screen", and a "login form".

I main my #1 form in vb to be the "Main Form.

On the OnLoad of the Main form, I call the splash screen.

The splash screen will show even before the main form paints.

Now, if you want the login form to show after the main form is painted,
the only way I have solved this by putting the login.show somewhere, is
kinda silly but it works. I added a timer to the main form, and put a
1/2 second timer delay on it.
When the timer fires, i timer.enabled = false, and i show my login form.

I realy couldnt figure out where to put the login form call so my main
form displays and then the login on top.

Miro
"Mitch5713" <mi***@nnex.netwrote in message
news:F9**********************************@microso ft.com...
>>I've got tthree forms at start up
splashscreen- works fine however how do i set the time delay so it stays
on
the window longer,, shows longer??
Loginscreen- works fine, after the data processing of username etc is
done I
then need to load, call whatever the syntax is the mainForm at the end
of the
loginscreen..????? how is that done so it starts at the mainForm_Load
procedure??? As it stands now the mainform loads but just for a split
second??>>

MItch



Oct 15 '06 #7
Miro,

Do you mean that your mainform is not showed after this, than there is
something terrible wrong.

If the login is correct, it does not close the mainform but shows it.

:-)

Cor

"Miro" <mi******@golden.netschreef in bericht
news:%2****************@TK2MSFTNGP02.phx.gbl...
Yes in my case however I wanted to show the main form.

So I needed to use the timer to display it 1/2 second after the main form.
-Unless there is another way?

M.
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:es****************@TK2MSFTNGP02.phx.gbl...
>Miro,

You can use in this case in your load form method a login form that you
call with ShowDialog, if you use it like this than the mainform is not
even showed.

If myLoginForm.ShowDialog <Dialogresult.OK then
messagebox.show("your login was wrong")
me.close
End if

I hope this helps,

Cor

"Miro" <mi******@golden.netschreef in bericht
news:e4**************@TK2MSFTNGP02.phx.gbl...
>>>I had a simillar issue.

I had a "main form", "a spash screen", and a "login form".

I main my #1 form in vb to be the "Main Form.

On the OnLoad of the Main form, I call the splash screen.

The splash screen will show even before the main form paints.

Now, if you want the login form to show after the main form is painted,
the only way I have solved this by putting the login.show somewhere, is
kinda silly but it works. I added a timer to the main form, and put a
1/2 second timer delay on it.
When the timer fires, i timer.enabled = false, and i show my login form.

I realy couldnt figure out where to put the login form call so my main
form displays and then the login on top.

Miro
"Mitch5713" <mi***@nnex.netwrote in message
news:F9**********************************@micros oft.com...
I've got tthree forms at start up
splashscreen- works fine however how do i set the time delay so it
stays on
the window longer,, shows longer??
Loginscreen- works fine, after the data processing of username etc is
done I
then need to load, call whatever the syntax is the mainForm at the end
of the
loginscreen..????? how is that done so it starts at the mainForm_Load
procedure??? As it stands now the mainform loads but just for a split
second??>>

MItch




Oct 16 '06 #8
No,

Just a misunderstanding,

I wanted my Login form Showing ontop of my Main form. So thats why I had
to use a timer - To show something after the mian form loads.
I was looking for something like MainForm.AfterLoadandPaint
but instead it was a 1/2 second timer that disables itself on its first run.
:)
I could not have a
Dim fLogon As Form = New frmLogon()
fLogon.ShowDialog()
in my _FormLoad of my Main form, cause I wanted to paint the back screen
prior to asking for a login.

Cheers,

Miro

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:e5**************@TK2MSFTNGP02.phx.gbl...
Miro,

Do you mean that your mainform is not showed after this, than there is
something terrible wrong.

If the login is correct, it does not close the mainform but shows it.

:-)

Cor

"Miro" <mi******@golden.netschreef in bericht
news:%2****************@TK2MSFTNGP02.phx.gbl...
>Yes in my case however I wanted to show the main form.

So I needed to use the timer to display it 1/2 second after the main
form.
-Unless there is another way?

M.
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:es****************@TK2MSFTNGP02.phx.gbl...
>>Miro,

You can use in this case in your load form method a login form that you
call with ShowDialog, if you use it like this than the mainform is not
even showed.

If myLoginForm.ShowDialog <Dialogresult.OK then
messagebox.show("your login was wrong")
me.close
End if

I hope this helps,

Cor

"Miro" <mi******@golden.netschreef in bericht
news:e4**************@TK2MSFTNGP02.phx.gbl...
I had a simillar issue.

I had a "main form", "a spash screen", and a "login form".

I main my #1 form in vb to be the "Main Form.

On the OnLoad of the Main form, I call the splash screen.

The splash screen will show even before the main form paints.

Now, if you want the login form to show after the main form is painted,
the only way I have solved this by putting the login.show somewhere, is
kinda silly but it works. I added a timer to the main form, and put a
1/2 second timer delay on it.
When the timer fires, i timer.enabled = false, and i show my login
form.

I realy couldnt figure out where to put the login form call so my main
form displays and then the login on top.

Miro
"Mitch5713" <mi***@nnex.netwrote in message
news:F9**********************************@micro soft.com...
I've got tthree forms at start up
splashscreen- works fine however how do i set the time delay so it
stays on
the window longer,, shows longer??
Loginscreen- works fine, after the data processing of username etc is
done I
then need to load, call whatever the syntax is the mainForm at the end
of the
loginscreen..????? how is that done so it starts at the mainForm_Load
procedure??? As it stands now the mainform loads but just for a split
second??>>
>
MItch




Oct 16 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Matthew Wells | last post: by
9 posts views Thread by John Kirksey | last post: by
reply views Thread by Frank 'Olorin' Rizzi | last post: by
3 posts views Thread by Dennis | last post: by
2 posts views Thread by **Developer** | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.