-
Jun 25th, 2005, 03:32 AM
#1
Thread Starter
Hyperactive Member
Progress Bar while loading another form
Hi
I have two forms, Form1, Form2
I use a CommandButton to move from one form to another.
I use this code:
This code works fine but the second form doesn't show up instantly because there is alot of code in its Form_Load event.
Is there any way to display for example a progress bar while loading the other form and then show up the form when its load completes.
Thanks
-
Jun 25th, 2005, 03:39 AM
#2
Re: Progress Bar while loading another form
Put the events into the Form_Activate section. Place a label at the start, that disapears at the end of the loading.
VB Code:
label1.caption = "One moment, please..."
-
Jun 25th, 2005, 03:52 AM
#3
Thread Starter
Hyperactive Member
Re: Progress Bar while loading another form
I already put the code in Form_Activate() but the form hangs for a while and then it shows up
-
Jun 25th, 2005, 04:06 AM
#4
Re: Progress Bar while loading another form
Put the code in a sub, and call it from form_activate? that should show it first.
-
Jun 25th, 2005, 04:24 AM
#5
Re: Progress Bar while loading another form
Add a third form to your project (named frmWait). Add label etc. to that form to show whatever message you want to show to user while he waits.
And modify the load event of your Form2 as follows:
VB Code:
Private Sub Form_Load()
frmWait.Show , Me
frmWait.Refresh
'
'
' Your other code here
'
'
Unload frmWait
End Sub
-
Jun 26th, 2005, 12:00 AM
#6
Thread Starter
Hyperactive Member
Re: Progress Bar while loading another form
Thanks Pradeep.
I appreciate ur help.
-
Feb 13th, 2018, 02:39 AM
#7
Member
Re: Progress Bar while loading another form
Originally Posted by Pradeep1210
Add a third form to your project (named frmWait). Add label etc. to that form to show whatever message you want to show to user while he waits.
And modify the load event of your Form2 as follows:
VB Code:
Private Sub Form_Load() frmWait.Show , Me frmWait.Refresh ' ' ' Your other code here ' ' Unload frmWait End Sub
why the code is not working with me on visual studio 2012 ?
-
Feb 13th, 2018, 03:11 AM
#8
Re: Progress Bar while loading another form
Because vb.net is not the same as vb6!
-
Feb 13th, 2018, 03:15 AM
#9
Member
Re: Progress Bar while loading another form
Originally Posted by Arnoutdv
Because vb.net is not the same as vb6!
would you please help in vb.net as I badly need it PLEASE
-
Feb 13th, 2018, 07:51 AM
#10
Re: Progress Bar while loading another form
Best this Thread get posted in the VB.NET part of this Forum...MORE users of that app there. I'll report to the Moderators to ask if they will move it for you.
-
Feb 13th, 2018, 08:08 AM
#11
Re: Progress Bar while loading another form
No, don't... he's already got a thread... and is getting bad advice from it. Got one post that has a decent answer, is choosing to ignore it.
-tg
-
Feb 13th, 2018, 09:10 AM
#12
Re: Progress Bar while loading another form
Okaaay. Shall I take bids?
This is a really old thread. Advice in this thread was for VB6, and will not necessarily apply to VS2012, which is .NET. Since there is already a thread over there, and since nothing meaningful has happened in this thread except that which was thirteen years ago, this might as well remain here. I'm tempted to close it, but that probably isn't justified.
My usual boring signature: Nothing
-
Feb 13th, 2018, 11:24 AM
#13
Re: Progress Bar while loading another form
vbuser99,
I know the answer, and it's a good one too. Rewrite the rest of your app in VB6. That way, you can come over here and get advice that'll actually help you.
Take Care,
Elroy
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
-
Feb 13th, 2018, 11:49 AM
#14
Re: Progress Bar while loading another form
Originally Posted by Elroy
vbuser99,
I know the answer, and it's a good one too. Rewrite the rest of your app in VB6. That way, you can come over here and get advice that'll actually help you.
Take Care,
Elroy
LOL
regards
Chris
to hunt a species to extinction is not logical !
since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.
-
Feb 13th, 2018, 08:08 PM
#15
Re: Progress Bar while loading another form
Hey, Microsoft seems to be leaving VB.NET behind as they did VB6, so maybe all the VB netters will come on home to VB6 where they belong.
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
-
Feb 15th, 2018, 04:29 PM
#16
Re: Progress Bar while loading another form
The VB .NETters who matter are either already using C# or completely moved on to other platforms years ago. You don't want the ones who are starting new projects in VB .NET. Trust me.
They're the kind of people that create a thread that goes like:
"Hi, I'm doing a lot of work on the UI thread and my form freezes what do?"
> "You should do that work on a worker thread so the UI can display progress updates."
"OK, I put an animated GIF on the form but it freezes???"
>
"Tell you what, I'll go ask the VB6 guys."
This answer is wrong. You should be using TableAdapter and Dictionaries instead.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|