|
-
Feb 27th, 2007, 05:54 PM
#1
Thread Starter
Lively Member
Waiting command
Hi everyone,
I have several buttons and a 2 picture boxes. When you press any button, a certain image on the web is showed in the first picture box.
The second picture box is invisible I use to display a loading image.
What I want to do is that when you press a button it will make the second picture box visible and display for about 3 seconds.
I tried this but it wont work
Any help would be great
Code:
PictureBox2.Visible = True
Me.PictureBox1.ImageLocation = "http://i.cnn.net/cnn/.element/img/1.0/weather/accu/samsat.png"
Threading.Thread.Sleep(2000)
PictureBox2.Visible = False
I use vb.net express 2005
Regards,
Alex
-
Feb 27th, 2007, 06:00 PM
#2
Re: Waiting command
Well if you really want to put the thread to sleep, check this thread. But I would really advice you to use a Timer instead.
-
Feb 27th, 2007, 06:02 PM
#3
Re: Waiting command
You only need one PictureBox to do this. Set the InitialImage property of the PictureBox to a local image, then do this:
Code:
Me.PictureBox1.LoadAsync("http://i.cnn.net/cnn/.element/img/1.0/weather/accu/samsat.png")
The PictureBox will display your InitialImage while the main image is loading, then replace it once the main image has finished downloading.
-
Feb 27th, 2007, 07:21 PM
#4
Thread Starter
Lively Member
Re: Waiting command
Thanks guys
jmcilhinney, its as if you read my mind. Thats what I wanted to do but though it was not possible, so I resorted to my other way.
Thanks,
Alex
-
Feb 27th, 2007, 08:01 PM
#5
Re: Waiting command
 Originally Posted by ARanc
Thanks guys
jmcilhinney, its as if you read my mind.  Thats what I wanted to do but though it was not possible, so I resorted to my other way.
Thanks,
Alex
Yeah, reading minds is why JM decided to use "apprentice idiot" as his user title. I haven't figured it out yet, though I assume it is some kind of zen thing.
My usual boring signature: Nothing
 
-
Feb 27th, 2007, 08:08 PM
#6
Thread Starter
Lively Member
Re: Waiting command
Jim,
I tried what you did but it did not work.
The problem is that each button when pressed is referring to the same image location. When I first run the program the initial image is shown. But once I press the other button , the first loaded image will show until the other one is loaded; no initial image is show. However, I did figure out a solution.
Here is the code, I hope this might help someone
Code:
Me.PictureBox19.Image = Nothing
Me.PictureBox19.LoadAsync("http://i.cnn.net/cnn/.element/img/1.0/weather/accu/samsat.png")
Last edited by ARanc; Feb 27th, 2007 at 08:26 PM.
Regards,
Alex
I use Visual Basic 2005 Express Edition
-
Feb 27th, 2007, 08:33 PM
#7
Re: Waiting command
That's not A solution. It's THE solution.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|