I have a function that populates a ComboBox with a bunch of names.
To populate it I have to make a function call to an external class library (which is poorly designed) many many times (512 to be exact)....you can see that this will take a while.
After populating the ComboBox I initialize a user control which displays details about the first selected item.
Since it takes a couple of seconds to populate the ComboBox before the user control can be loaded I created a function that hides the user control (and any other controls that aren't available until everything's loaded) and display a "loading" message.
Expand|Select|Wrap|Line Numbers
- Private Sub Updating()
- 'Centering the message
- Dim x As Integer = theGroupBoxHoldingEveryThingWidth / 2 - UpdatingMessage.Width / 2
- Dim y As Integer = theGroupBoxHoldingEveryThingWidth .Height / 2 - UpdatingMessage.Height / 2
- UpdatingMessage.Location = New Point(x, y)
- 'Hiding the controls and displaying the message
- thePanelHoldingTheControls.Hide()
- UpdatingMessage.Show()
- End Sub
Expand|Select|Wrap|Line Numbers
- Private Sub UpdatingFinished()
- 'Hiding the message and displaying the controls
- thePanelHoldingTheControls.Show()
- UpdatingMessage.Hide()
- End Sub
Originally I was using the Visible property to display updating message and hide the controls but since this didn't work I changed it to the Show() and Hide() methods.
I've stepped through the application and expected the content to be hidden as soon as the Hide() method was executed but this is not the case.
Does anyone know why this is happening?
Thanks for your time,
-Frinny