473,406 Members | 2,390 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

[C#]finished print

4
How can i do to check when the print is finished in my method?
Expand|Select|Wrap|Line Numbers
  1.         private void PrintHTMLPage(string url)
  2.         {
  3.             // Create a WebBrowser instance. 
  4.             WebBrowser webBrowserForPrinting = new WebBrowser();
  5.  
  6.             // Add an event handler that prints the document after it loads.
  7.             webBrowserForPrinting.DocumentCompleted +=
  8.                 new WebBrowserDocumentCompletedEventHandler(PrintDocument);
  9.  
  10.             // Set the Url property to load the document.
  11.             webBrowserForPrinting.Url = new Uri(@url);
  12.  
  13.         }
  14.  
  15.         private void PrintDocument(object sender,
  16.             WebBrowserDocumentCompletedEventArgs e)
  17.         {
  18.  
  19.             // Print the document now that it is fully loaded.
  20.             ((WebBrowser)sender).Print();
  21.  
  22.             // Dispose the WebBrowser now that the task is complete. 
  23.             ((WebBrowser)sender).Dispose();
  24.         }
  25.  
thanks
Jan 29 '07 #1
1 2461
kenobewan
4,871 Expert 4TB
You may find using asp.net threads useful:
Use Threads and Build Asynchronous Handlers in Your Server-Side Web Code
Jan 30 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Bernhard | last post by:
I am not sure if php can achieve this, but i guess that my problem shoulb be solved with an server side language. Is there any way i can tell if a visitor of my website has finished a download?...
1
by: BKM | last post by:
I've been using the following 2 ways to make sure my WebBrowser is finished loading a page before continuing with the next code. do:doevents:loop while WebBrowser.Busy do:doevents:loop until...
1
by: Nico Leiska | last post by:
How would it be possible to print some output before the script is finished, or a line at a time if possible with HTML specs? This is because I'm running a LDAP query that takes some 30-60...
77
by: Jon Skeet [C# MVP] | last post by:
Please excuse the cross-post - I'm pretty sure I've had interest in the article on all the groups this is posted to. I've finally managed to finish my article on multi-threading - at least for...
0
by: Chuck Insight | last post by:
Hi All, I just finished creating my first all-inclusive MS-Access application. Ideally, I would prefer to prevent mischievous users from accessing everything except the switchboard items. This...
1
by: pj | last post by:
Hi, I want to measure host loads (using system(uptime)) every 10 seconds while I am running an application written in C, and write the host load average during the application execution to a...
6
by: Chris Newcombe | last post by:
Please could someone on the VC++ 7.0 compiler team (note; not 7.1) tell me if this code is handled 'correctly' (i.e. as the original poster suggests) in all cases? ...
4
by: KMEscherich | last post by:
Using Access '97 I have a sub-form on a main form that allows for 5 line items to be made against each PRIMARY KEY. On this sub-form, I have a FINISHED checkbox that the end-user is to select when...
6
by: Eraser | last post by:
hi guys.... how i would now that the iframe loading of chart fx graph is completed... i used a window.print on page load with multiple iframes on the same page.... what happen is once the print...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.