Click here to Skip to main content
15,882,055 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionChanging JPG in picturebox with loop Pin
Dr David Johnson PhD14-May-12 12:02
Dr David Johnson PhD14-May-12 12:02 
AnswerRe: Changing JPG in picturebox with loop Pin
Dave Kreskowiak14-May-12 13:18
mveDave Kreskowiak14-May-12 13:18 
GeneralRe: Changing JPG in picturebox with loop Pin
Dr David Johnson PhD14-May-12 15:29
Dr David Johnson PhD14-May-12 15:29 
AnswerRe: Changing JPG in picturebox with loop Pin
Luc Pattyn14-May-12 15:43
sitebuilderLuc Pattyn14-May-12 15:43 
GeneralRe: Changing JPG in picturebox with loop Pin
Dr David Johnson PhD14-May-12 17:14
Dr David Johnson PhD14-May-12 17:14 
AnswerRe: Changing JPG in picturebox with loop Pin
Luc Pattyn14-May-12 17:34
sitebuilderLuc Pattyn14-May-12 17:34 
GeneralRe: Changing JPG in picturebox with loop Pin
Dr David Johnson PhD14-May-12 17:59
Dr David Johnson PhD14-May-12 17:59 
GeneralRe: Changing JPG in picturebox with loop Pin
dg6yhw1115-May-12 6:38
dg6yhw1115-May-12 6:38 
I'd like to amplify the other excellent answers a bit.

I am a VB 6 programmer so I may refer to methods that have changed but they are described in the Help.

You need to have a timer to slow down the process.

Whenever the timer acts, you need to
1 - load the image into the picturebox picturebox.image=...
2 - refresh the picturebox by calling the Refresh picturebox.refresh (may also be Redraw check the Help)
3 - let Windows process the action. application.DoEvents

Its the DoEvents directive that causes Windows to suspend the current thread and process all messages i.e. the picturebox.Refresh method will be executed.

Search the DoEvents in Help for an excellent discussion and sample code. The sample uses a click event from a button but you can just as easily control the process with a timer.

Your images should change whenever the timer ticks.
Murray

GeneralRe: Changing JPG in picturebox with loop Pin
Dr David Johnson PhD15-May-12 11:24
Dr David Johnson PhD15-May-12 11:24 
AnswerRe: Changing JPG in picturebox with loop Pin
Luc Pattyn15-May-12 12:06
sitebuilderLuc Pattyn15-May-12 12:06 
QuestionDevshock.Net Pin
Midnight Ahri13-May-12 17:15
Midnight Ahri13-May-12 17:15 
AnswerRe: Devshock.Net Pin
Richard MacCutchan13-May-12 22:01
mveRichard MacCutchan13-May-12 22:01 
GeneralRe: Devshock.Net Pin
Midnight Ahri13-May-12 22:42
Midnight Ahri13-May-12 22:42 
GeneralRe: Devshock.Net Pin
Richard MacCutchan13-May-12 22:48
mveRichard MacCutchan13-May-12 22:48 
AnswerRe: Devshock.Net Pin
Midnight Ahri13-May-12 23:52
Midnight Ahri13-May-12 23:52 
GeneralRe: Devshock.Net Pin
Richard MacCutchan14-May-12 0:05
mveRichard MacCutchan14-May-12 0:05 
GeneralRe: Devshock.Net Pin
Richard MacCutchan14-May-12 0:19
mveRichard MacCutchan14-May-12 0:19 
GeneralRe: Devshock.Net Pin
Luc Pattyn14-May-12 0:52
sitebuilderLuc Pattyn14-May-12 0:52 
GeneralRe: Devshock.Net Pin
Richard MacCutchan14-May-12 0:56
mveRichard MacCutchan14-May-12 0:56 
AnswerRe: Devshock.Net Pin
Dave Kreskowiak14-May-12 2:13
mveDave Kreskowiak14-May-12 2:13 
Questionhow to controll cells inside Table1DataGridView Pin
romo2213-May-12 12:58
romo2213-May-12 12:58 
AnswerRe: how to controll cells inside Table1DataGridView Pin
JohnPayton13-May-12 15:34
JohnPayton13-May-12 15:34 
GeneralRe: how to controll cells inside Table1DataGridView Pin
romo2213-May-12 16:47
romo2213-May-12 16:47 
AnswerRe: how to controll cells inside Table1DataGridView Pin
Luc Pattyn13-May-12 16:05
sitebuilderLuc Pattyn13-May-12 16:05 
GeneralRe: how to controll cells inside Table1DataGridView Pin
romo2213-May-12 16:49
romo2213-May-12 16:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.