C
Cerebrus99
Hi all,
I'm making a Windows application that does some lengthy retrieval operations
from a database and possibly from a internet resource.
I want to show that the operation is going on, by using an Animated .gif in
a picture box. Also note that this PictureBox also acts as the button to
invoke this lengthy operation. In other words, the user will click the
PicBox to start the operation. When clicked, I update the Image property of
the PicBox to the Animated .gif, and then call the lengthy method. I also
change the Tooltip of the PicBox to something like "Retrieving... please
wait...". At the end of the operation, I want to reset the Image property of
the PicBox.
The problem is that the PicBox image just freezes until the operation is
complete, by then it is already time to reset the Image. How do I show the
progress in this case ? The tooltip however, gets changed, which means that
the problem is mainly with updating the image. I have also noticed that the
form will not repaint, if I bring another application over it, and restore
it.
I have tried to call Application.DoEvents() at the start of my lengthy
method, but it never seems to have any effect whatsoever.
My concepts are a bit shaky as far as Asynchronous calls are concerned, so I
was wondering if there is any other way to prevent the UI from freezing up.
Any help is appreciated.
Regards,
Cerebrus.
I'm making a Windows application that does some lengthy retrieval operations
from a database and possibly from a internet resource.
I want to show that the operation is going on, by using an Animated .gif in
a picture box. Also note that this PictureBox also acts as the button to
invoke this lengthy operation. In other words, the user will click the
PicBox to start the operation. When clicked, I update the Image property of
the PicBox to the Animated .gif, and then call the lengthy method. I also
change the Tooltip of the PicBox to something like "Retrieving... please
wait...". At the end of the operation, I want to reset the Image property of
the PicBox.
The problem is that the PicBox image just freezes until the operation is
complete, by then it is already time to reset the Image. How do I show the
progress in this case ? The tooltip however, gets changed, which means that
the problem is mainly with updating the image. I have also noticed that the
form will not repaint, if I bring another application over it, and restore
it.
I have tried to call Application.DoEvents() at the start of my lengthy
method, but it never seems to have any effect whatsoever.
My concepts are a bit shaky as far as Asynchronous calls are concerned, so I
was wondering if there is any other way to prevent the UI from freezing up.
Any help is appreciated.
Regards,
Cerebrus.