Background:
I am generating a Windows Form application whose main functionality is to consult information through a web service.
The design of the (controls) form consists of:
- (1) TextBox
- (1) Button
Due to the latency of the response, it is necessary to inform the user that once the button is pressed to activate the request the system will take a while to respond. According to the tests I have done, the request takes between 3 to 5 seconds (even a little more) .
For this, I intend to use one of the following options:
The second form FrmMsg has the following controls:
- PictureBox (with a .GIF file)
- Label "with text set by default".
- Button (to close the form) .
- Property
FormBorderStyle = None
.
The design of the alternative solutions that I have described looks like this:
Problem:
I have chosen (for reasons of time for development) to use option 2 or 3 above; however, when you activate the button to make the request, the following problems appear:
- With the Hidden Panel , it takes time to visualize. The request takes between 3-5 seconds to complete and I consider that (even though the property
Visible
changes fromFalse
toTrue
) the interface of the program is frozen and therefore , no change is visible (until the request is completed). - With the Second form FrmMsg , it is invoked, but the controls that this form has are translucent = the spaces destined for the controls are empty.
I tried to add the following line of code in different parts of the logic:
System.Threading.Thread.Sleep(1500); // 1.5 segundos.
PanelOculto.Visible = true;
But the visualization (either of the Panel or of the second form FrmMsg ) still does not generate the expected result.
What can be done to display the Panel and / or the second form correctly?