This question may seem a bit newbie-ish but I'm new to desktop applications... please bear with me.
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.
[code=vbnet]
Private Sub Updating()
'Centering the message
Dim x As Integer = theGroupBoxHold ingEveryThingWi dth / 2 - UpdatingMessage .Width / 2
Dim y As Integer = theGroupBoxHold ingEveryThingWi dth .Height / 2 - UpdatingMessage .Height / 2
UpdatingMessage .Location = New Point(x, y)
'Hiding the controls and displaying the message
thePanelHolding TheControls.Hid e()
UpdatingMessage .Show()
End Sub
[/code]
I created a function that displays the content and hides the message:
[code=vbnet]
Private Sub UpdatingFinishe d()
'Hiding the message and displaying the controls
thePanelHolding TheControls.Sho w()
UpdatingMessage .Hide()
End Sub
[/code]
The problem is that the controls are not hidden and the message is not shown while the processing is going on.
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
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.
[code=vbnet]
Private Sub Updating()
'Centering the message
Dim x As Integer = theGroupBoxHold ingEveryThingWi dth / 2 - UpdatingMessage .Width / 2
Dim y As Integer = theGroupBoxHold ingEveryThingWi dth .Height / 2 - UpdatingMessage .Height / 2
UpdatingMessage .Location = New Point(x, y)
'Hiding the controls and displaying the message
thePanelHolding TheControls.Hid e()
UpdatingMessage .Show()
End Sub
[/code]
I created a function that displays the content and hides the message:
[code=vbnet]
Private Sub UpdatingFinishe d()
'Hiding the message and displaying the controls
thePanelHolding TheControls.Sho w()
UpdatingMessage .Hide()
End Sub
[/code]
The problem is that the controls are not hidden and the message is not shown while the processing is going on.
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
Comment