Click here to Skip to main content
15,894,825 members
Home / Discussions / C#
   

C#

 
QuestionUpdate progress bar on another form Pin
Etienne_1232-Mar-11 21:28
Etienne_1232-Mar-11 21:28 
AnswerRe: Update progress bar on another form Pin
musefan2-Mar-11 22:29
musefan2-Mar-11 22:29 
GeneralRe: Update progress bar on another form Pin
Etienne_1233-Mar-11 21:17
Etienne_1233-Mar-11 21:17 
AnswerRe: Update progress bar on another form Pin
DaveyM693-Mar-11 1:13
professionalDaveyM693-Mar-11 1:13 
GeneralRe: Update progress bar on another form Pin
Luc Pattyn3-Mar-11 1:36
sitebuilderLuc Pattyn3-Mar-11 1:36 
GeneralRe: Update progress bar on another form Pin
DaveyM693-Mar-11 3:58
professionalDaveyM693-Mar-11 3:58 
GeneralRe: Update progress bar on another form Pin
Etienne_1233-Mar-11 20:00
Etienne_1233-Mar-11 20:00 
QuestionPausing execution for certain amount of time without freezing the form. Pin
john1234512-Mar-11 14:48
john1234512-Mar-11 14:48 
Here is some code in one of my methods:

webBrowser1.Focus();<br />
System.Windows.Forms.SendKeys.Send("{PGDN}");


I'm using this to force the webbrowser to scroll down so that a picture on the site I'm using is on screen.

Then I use:

findClick();

I have coded this to mean: using(image1) find image on screen and click.
It works fine.

MY PROBLEM IS:

(here is the next line of code):

webBrowser1.Focus();<br />
System.Windows.Forms.SendKeys.Send("{PGDN}");<br />
Point one = this.Location; //at this section my program doesn't wait for the above two commands to run before starting this line<br />
//it runs the code before the screen has been scrolled so my picture finder never gets found.


How do I wait for a certain amount of time before executing the next line of command?
THREAD.SLEEP DOESN'T WORK!!!!!!!!!!
This command freezes the form and doesn't do anything for this problem. I also cannot use timers because I need the code to remain in this method (preferably in one line, like thread.Sleep)

How would I go about doing this?

ANOTHER SIMILAR PROBLEM:

using:
webBrowser1.Navigate("http://google.com");<br />
second command;<br />
third command;


This doesn't wait for the first command to finish so I would like to place a timer that says wait(5000) then continue.
I KNOW ABOUT DOCUMENTCOMPLETED events, I'm using this as an example!
AnswerRe: Pausing execution for certain amount of time without freezing the form. Pin
Luc Pattyn2-Mar-11 15:31
sitebuilderLuc Pattyn2-Mar-11 15:31 
AnswerRe: Pausing execution for certain amount of time without freezing the form. Pin
OriginalGriff2-Mar-11 21:19
mveOriginalGriff2-Mar-11 21:19 
GeneralRe: Pausing execution for certain amount of time without freezing the form. Pin
Luc Pattyn3-Mar-11 0:53
sitebuilderLuc Pattyn3-Mar-11 0:53 
AnswerRe: Pausing execution for certain amount of time without freezing the form. Pin
musefan2-Mar-11 22:20
musefan2-Mar-11 22:20 
QuestionConsole in c# 2008 Express Pin
Bob Pawley2-Mar-11 12:47
Bob Pawley2-Mar-11 12:47 
AnswerRe: Console in c# 2008 Express Pin
Dave Kreskowiak2-Mar-11 12:59
mveDave Kreskowiak2-Mar-11 12:59 
AnswerRe: Console in c# 2008 Express Pin
DaveyM692-Mar-11 13:32
professionalDaveyM692-Mar-11 13:32 
AnswerRe: Console in c# 2008 Express Pin
I Believe In GOD2-Mar-11 21:16
I Believe In GOD2-Mar-11 21:16 
QuestionHow to select a radio button in internet explorer. Pin
sososm2-Mar-11 11:46
sososm2-Mar-11 11:46 
QuestionLastinputinfo() not working on my machine ... Pin
turbosupramk32-Mar-11 10:51
turbosupramk32-Mar-11 10:51 
AnswerRe: Lastinputinfo() not working on my machine ... Pin
Eddy Vluggen2-Mar-11 11:08
professionalEddy Vluggen2-Mar-11 11:08 
AnswerRe: Lastinputinfo() not working on my machine ... [modified] Pin
DaveyM692-Mar-11 12:11
professionalDaveyM692-Mar-11 12:11 
GeneralRe: Lastinputinfo() not working on my machine ... Pin
turbosupramk33-Mar-11 6:08
turbosupramk33-Mar-11 6:08 
GeneralRe: Lastinputinfo() not working on my machine ... Pin
DaveyM693-Mar-11 6:58
professionalDaveyM693-Mar-11 6:58 
QuestionGetting the relevent letter for unicode. Pin
prasadbuddhika2-Mar-11 6:46
prasadbuddhika2-Mar-11 6:46 
AnswerRe: Getting the relevent letter for unicode. Pin
Richard MacCutchan2-Mar-11 6:55
mveRichard MacCutchan2-Mar-11 6:55 
AnswerRe: Getting the relevent letter for unicode. Pin
Eddy Vluggen2-Mar-11 7:24
professionalEddy Vluggen2-Mar-11 7:24 

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.