Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I have an MDI app and one of the child forms takes a few seconds to open up. I want to put a progress bar in the status bar of the MDIParent that tracks the progress of the form opening. My problem is that I don't know how to get the progress of the form opening. Is it possible??
Being smarter than you look is always better than looking smarter than you are.
  • Leaders
Posted
If you can't get any progress indicator, then that will defeat the whole purpose of a progress bar. ;)

Iceplug, USN

One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(

Posted

Solution (for now...)

 

I thought of a to "cheat" a bit. On the MDIParent form, I placed a timer and in the Tick event, I increment the progress bar. Then, I put a switch in so when the progressbar value reaches (let's just say 75) is fires off the child form's Show() method and then, when the progressbar's value hits 100, it sets the visibility to false. Here's what the code looks like...

 

Me.ProgressBar1.Value += 1
Dim f As Form2 = New Form2
f.MdiParent = Me
Select Case Me.ProgressBar1.Value
     Case 75
         f.Show()
     Case 100
         Me.ProgressBar1.Visible = False
         Me.Timer2.Enabled = False
End Select

 

I haven't tried this at work (where the real project is...) yet but, I have feeling this will do the trick untill I can find a better way to do it.

Being smarter than you look is always better than looking smarter than you are.
Posted
I have no idea...nor do I know how to find out. There's nothing on it but normal controls. Nothing fancy, and, as it turns out, it's only the first time it opens. If I open subsequent iterations of the form, it's pretty fast. I dunno, I was just trying to deal with it.
Being smarter than you look is always better than looking smarter than you are.
Posted
I have no idea...nor do I know how to find out. There's nothing on it but normal controls. Nothing fancy, and, as it turns out, it's only the first time it opens. If I open subsequent iterations of the form, it's pretty fast. I dunno, I was just trying to deal with it.

 

Are you filling a dataset? Anything that would take time? Does Form_Load call anything that would explain why the first load takes so long but subsequent loads don't? Post code. We'll perform a full biopsy,

"It may be roundly asserted that human ingenuity cannot concoct a cipher which human ingenuity cannot resolve."

 

- Edgar Allan Poe, 1841

 

I long to accomplish great and noble tasks, but it is my chief duty to accomplish humble tasks as though they were great and noble. The world is moved along, not only by the mighty shoves of its heroes, but also by the aggregate of the tiny pushes of each honest worker.

 

- Helen Keller

Posted
I'm populating a couple of comboboxes from an array. That's it. no data retieval or manipulation of any kind. I'll have post the code tomorrow when I get to work...
Being smarter than you look is always better than looking smarter than you are.
Posted (edited)

Slow loading form...

 

Here is the project (i thought it may help to be able to see it all...). I went over the code this morning and the only thing in the child form's load is a call to 3 subs to format some datagrids. I tried commenting the calls and the sub out and no chnge...

slow loading form.zip

Edited by PlausiblyDamp
Being smarter than you look is always better than looking smarter than you are.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...