Click here to Skip to main content
15,884,425 members
Home / Discussions / C#
   

C#

 
Questionhow to use webbrowserControl Pin
pashitech3-Apr-07 6:22
pashitech3-Apr-07 6:22 
AnswerRe: how to use webbrowserControl Pin
Douglas Troy3-Apr-07 6:30
Douglas Troy3-Apr-07 6:30 
QuestionJust problems... Pin
lost in transition 3-Apr-07 5:39
lost in transition 3-Apr-07 5:39 
AnswerRe: Just problems... Pin
Vikram A Punathambekar3-Apr-07 7:09
Vikram A Punathambekar3-Apr-07 7:09 
GeneralRe: Just problems... Pin
lost in transition 3-Apr-07 8:01
lost in transition 3-Apr-07 8:01 
QuestionXml Confusion Pin
Mark F.3-Apr-07 5:24
Mark F.3-Apr-07 5:24 
AnswerRe: Xml Confusion Pin
kubben3-Apr-07 6:03
kubben3-Apr-07 6:03 
QuestionHelp with automated html to image capture Pin
justlee73-Apr-07 5:10
justlee73-Apr-07 5:10 
First off, I am a Windows network technician with some coding back ground, mostly in C++ and VB, new to C#, so please bear with me.

I am trying to modify the following project by Douglas M. Weems (thanks a bunch Douglas for the code, it's been a GREAT help):

http://www.codeproject.com/cs/media/IECapture.asp[^]

We have a need to automate the process of capturing web sites of our clients as images. To do this I am modifying Douglas' project to do so. I have made most of the changes we require, but am stuck on one, hopefully last, issue.

I added a WebBrowser control, and modified the code to read the site loaded in it rather then from the first available web browser window open.

My problem is that when I automatically run the the button_click event which has the image capture code, the WebBrowser control does not load quickly enough, and the code calls properties of this control that are set to "null".

If I launch the app, and manually click the button which runs the capture code, it works without an issue, the image captures.

This is how I setup the automated process. On the Form Load event I read in a text file with the URL, and the WebBrowser control called axWebCap browses to this site. I then run the capture code in the Form Activated event.

I discovered that if I do this, that axWebCap.ReadyState = READYSTATE_LOADING. Now if I run this manually by running the ap and click the capture button the axWebCap.ReadyState = READYSTATE_COMPLETE.

I guess my question is, how can I run this code in a function after the Form has completely loaded, and therefore the axWebCap WebBrowser control has completely loaded as well, and it's properties are no longer set to null?

BTW, I am using Visual C# 2005 EE, and I would be more then happy to clarify anything I just posted.

Any help would be greatly appreciated!

Thanks,
Justin
AnswerRe: Help with automated html to image capture Pin
Douglas Troy3-Apr-07 5:45
Douglas Troy3-Apr-07 5:45 
GeneralRe: Help with automated html to image capture Pin
justlee73-Apr-07 5:57
justlee73-Apr-07 5:57 
GeneralRe: Help with automated html to image capture Pin
Douglas Troy3-Apr-07 6:15
Douglas Troy3-Apr-07 6:15 
GeneralRe: Help with automated html to image capture Pin
justlee73-Apr-07 6:48
justlee73-Apr-07 6:48 
GeneralRe: Help with automated html to image capture [modified] Pin
Douglas Troy3-Apr-07 7:09
Douglas Troy3-Apr-07 7:09 
GeneralRe: Help with automated html to image capture Pin
justlee73-Apr-07 10:20
justlee73-Apr-07 10:20 
GeneralRe: Help with automated html to image capture Pin
Douglas Troy3-Apr-07 10:41
Douglas Troy3-Apr-07 10:41 
GeneralRe: Help with automated html to image capture Pin
justlee73-Apr-07 10:44
justlee73-Apr-07 10:44 
GeneralRe: Help with automated html to image capture Pin
Douglas Troy3-Apr-07 19:50
Douglas Troy3-Apr-07 19:50 
QuestionDrag and drop listview Pin
Diego F.3-Apr-07 5:03
Diego F.3-Apr-07 5:03 
AnswerRe: Drag and drop listview Pin
led mike3-Apr-07 6:01
led mike3-Apr-07 6:01 
GeneralRe: Drag and drop listview Pin
Diego F.3-Apr-07 21:52
Diego F.3-Apr-07 21:52 
QuestionHow to save Excel object for further use? Pin
BlackBar3-Apr-07 4:40
BlackBar3-Apr-07 4:40 
AnswerRe: How to save Excel object for further use? Pin
Douglas Troy3-Apr-07 5:35
Douglas Troy3-Apr-07 5:35 
GeneralRe: How to save Excel object for further use? Pin
BlackBar3-Apr-07 8:55
BlackBar3-Apr-07 8:55 
QuestionSQL Files Pin
hadad3-Apr-07 4:20
hadad3-Apr-07 4:20 
AnswerRe: SQL Files Pin
Douglas Troy3-Apr-07 7:15
Douglas Troy3-Apr-07 7:15 

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.