Click here to Skip to main content
15,914,447 members
Home / Discussions / C#
   

C#

 
AnswerRe: Class inference Pin
Christian Graus16-Dec-08 10:00
protectorChristian Graus16-Dec-08 10:00 
AnswerRe: Class inference Pin
Wendelius16-Dec-08 11:47
mentorWendelius16-Dec-08 11:47 
AnswerRe: Class inference Pin
Chamadness16-Dec-08 20:53
Chamadness16-Dec-08 20:53 
QuestionProblem drawing shapes when form is clicked Pin
SilentCodingOne16-Dec-08 8:42
SilentCodingOne16-Dec-08 8:42 
AnswerRe: Problem drawing shapes when form is clicked Pin
Christian Graus16-Dec-08 8:51
protectorChristian Graus16-Dec-08 8:51 
GeneralRe: Problem drawing shapes when form is clicked Pin
SilentCodingOne16-Dec-08 10:28
SilentCodingOne16-Dec-08 10:28 
GeneralRe: Problem drawing shapes when form is clicked Pin
Christian Graus16-Dec-08 12:55
protectorChristian Graus16-Dec-08 12:55 
QuestionThread.Sleep and WebBrowser... Okay to use together? Pin
Matthew Klein16-Dec-08 8:36
Matthew Klein16-Dec-08 8:36 
Hello all!

My block of code in question is this:
while (WB.IsBusy)
    System.Threading.Thread.Sleep(1);

WB is a System.Windows.Forms.WebBrowser.

My concern is that the WB object was created by my class and is in the same thread, so by sleeping I wonder if it will stop the WebBrowser from processing whatever its busy doing. So if the while ends up getting run 100 times did I just Sleep for 100 extra, unnecessary, milliseconds?

My reason for using the Sleep is so the processor usage doesn't peg out while waiting for the WebBrowser.

I imagine that most of the IsBusy time is spent waiting for content to download and that while the thread is sleeping Windows will keep loading the data into the stream, but I'm guessing and I have no idea how to check.

So, am I way off base here? Is there a better way to wait for a WebBrowser object to finish what its doing?

Thanks all!
AnswerRe: Thread.Sleep and WebBrowser... Okay to use together? Pin
Christian Graus16-Dec-08 8:52
protectorChristian Graus16-Dec-08 8:52 
GeneralRe: Thread.Sleep and WebBrowser... Okay to use together? Pin
Matthew Klein16-Dec-08 11:48
Matthew Klein16-Dec-08 11:48 
GeneralRe: Thread.Sleep and WebBrowser... Okay to use together? Pin
User 665816-Dec-08 11:57
User 665816-Dec-08 11:57 
GeneralRe: Thread.Sleep and WebBrowser... Okay to use together? Pin
Christian Graus16-Dec-08 13:14
protectorChristian Graus16-Dec-08 13:14 
GeneralRe: Thread.Sleep and WebBrowser... Okay to use together? Pin
Expert Coming16-Dec-08 16:26
Expert Coming16-Dec-08 16:26 
GeneralRe: Thread.Sleep and WebBrowser... Okay to use together? Pin
Christian Graus16-Dec-08 17:16
protectorChristian Graus16-Dec-08 17:16 
Questiontextbox validation Pin
Zeyad Jalil16-Dec-08 6:20
professionalZeyad Jalil16-Dec-08 6:20 
AnswerRe: textbox validation Pin
EliottA16-Dec-08 6:33
EliottA16-Dec-08 6:33 
AnswerRe: textbox validation Pin
Lev Danielyan16-Dec-08 6:52
Lev Danielyan16-Dec-08 6:52 
AnswerRe: textbox validation Pin
programmervb.netc++16-Dec-08 12:59
programmervb.netc++16-Dec-08 12:59 
AnswerRe: textbox validation Pin
DaveyM6916-Dec-08 13:35
professionalDaveyM6916-Dec-08 13:35 
QuestionWhere are the files?? Pin
Muammar©16-Dec-08 6:10
Muammar©16-Dec-08 6:10 
GeneralRe: Where are the files?? Pin
Luc Pattyn16-Dec-08 6:37
sitebuilderLuc Pattyn16-Dec-08 6:37 
GeneralRe: Where are the files?? Pin
Muammar©16-Dec-08 18:11
Muammar©16-Dec-08 18:11 
AnswerRe: Where are the files?? Pin
Dave Kreskowiak16-Dec-08 7:02
mveDave Kreskowiak16-Dec-08 7:02 
GeneralRe: Where are the files?? Pin
Muammar©16-Dec-08 18:13
Muammar©16-Dec-08 18:13 
AnswerRe: Where are the files?? Pin
Alan N16-Dec-08 7:14
Alan N16-Dec-08 7:14 

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.