Ndunks
New member
- Joined
 - May 25, 2011
 
- Messages
 - 2
 
- Programming Experience
 - 1-3
 
Hey, I need Help, I write this code:
' This calling the BackgroundWorker
Private Sub Button1_Click() Handles Button1.Click
BW.RunWorkerAsync()
End Sub
Private Sub BW_DoWork() Handles BW.DoWork
For y = 0 To Bmp.Height - 1
For x = 0 To Bmp.Width - 1
Bmp.SetPixel(x, y, Color.Black)
Me.PictureBox.Image = Bmp
System.Threading.Thread.Sleep(5)
Next x
Next y
End Sub
I will fill the picturebox with black color, and i need to see the process. but, when i execute the process, i got this error message:
Object is currently in use elsewhere.
How to do it???

	
		
			
		
		
	
				
			' This calling the BackgroundWorker
Private Sub Button1_Click() Handles Button1.Click
BW.RunWorkerAsync()
End Sub
Private Sub BW_DoWork() Handles BW.DoWork
For y = 0 To Bmp.Height - 1
For x = 0 To Bmp.Width - 1
Bmp.SetPixel(x, y, Color.Black)
Me.PictureBox.Image = Bmp
System.Threading.Thread.Sleep(5)
Next x
Next y
End Sub
I will fill the picturebox with black color, and i need to see the process. but, when i execute the process, i got this error message:
Object is currently in use elsewhere.
How to do it???