Click here to Skip to main content
15,890,185 members
Home / Discussions / C#
   

C#

 
GeneralRe: closing the main form after loading another form Pin
Heath Stewart17-Feb-04 5:26
protectorHeath Stewart17-Feb-04 5:26 
GeneralRe: closing the main form after loading another form Pin
Charlie Williams17-Feb-04 4:19
Charlie Williams17-Feb-04 4:19 
GeneralCalling Managed C++ code in a C# App Pin
granderson16-Feb-04 12:28
granderson16-Feb-04 12:28 
GeneralRe: Calling Managed C++ code in a C# App Pin
obelisk2916-Feb-04 19:41
obelisk2916-Feb-04 19:41 
GeneralMetrics 2 english 2 twips 2 whatever Pin
Tomaž Štih16-Feb-04 11:58
Tomaž Štih16-Feb-04 11:58 
GeneralRe: Metrics 2 english 2 twips 2 whatever Pin
Heath Stewart17-Feb-04 3:52
protectorHeath Stewart17-Feb-04 3:52 
GeneralPrinting from a webservice Pin
nathanreynolds16-Feb-04 11:31
nathanreynolds16-Feb-04 11:31 
GeneralRe: Printing from a webservice Pin
Heath Stewart17-Feb-04 3:26
protectorHeath Stewart17-Feb-04 3:26 
Is what you're printing documents that are send to the web service, or are you printing data passed to the web service? In the former case, you must invoke the application associated with that object. In many cases, the major programs support a "/print" switch or "print" verb. You could do something like the following:
ProcessStartInfo info = new ProcessStartInfo();
info.FileName = "path to document";
info.UseShellExecute = true;
info.Verb = "print";
Process.Start(info);
If you are printing data, you need a graphics handle in which to print. The .NET base class libraries allow you to instantiate a new PrintDocument and to attach handlers to its events like PrintPage, which pass a Graphics object in the PrintPageEventArgs. You can see the PrintDocument class documentation for an example. It is invoked from a Button on a form's Click event handler, but common sense would tell you that you don't need to invoke this from a control. Just instantiate the PrintDocument, attach your handlers, and do the painting on the PrintPageEventArgs.Graphics.

Note, it is likely that the username under which ASP.NET runs will require a Windows station, i.e. a Windows desktop session associated with it. Make sure that account under which ASP.NET runs ("ASPNET" by default) has the "Log in locally" privilege ("ASPNET" should by default).

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Printing from a webservice Pin
nathanreynolds17-Feb-04 10:55
nathanreynolds17-Feb-04 10:55 
GeneralRe: Printing from a webservice Pin
Heath Stewart17-Feb-04 13:13
protectorHeath Stewart17-Feb-04 13:13 
GeneralRe: Printing from a webservice Pin
nathanreynolds17-Feb-04 16:27
nathanreynolds17-Feb-04 16:27 
GeneralRe: Printing from a webservice Pin
Heath Stewart17-Feb-04 19:32
protectorHeath Stewart17-Feb-04 19:32 
GeneralRe: Printing from a webservice Pin
nathanreynolds18-Feb-04 2:27
nathanreynolds18-Feb-04 2:27 
GeneralRe: Printing from a webservice Pin
Heath Stewart18-Feb-04 4:11
protectorHeath Stewart18-Feb-04 4:11 
GeneralA GDI+ newbie problem Pin
cemlouis16-Feb-04 11:28
cemlouis16-Feb-04 11:28 
GeneralRe: A GDI+ newbie problem Pin
Charlie Williams16-Feb-04 16:14
Charlie Williams16-Feb-04 16:14 
GeneralRe: A GDI+ newbie problem Pin
cemlouis17-Feb-04 3:50
cemlouis17-Feb-04 3:50 
GeneralFill 50% of a drawing with a color Pin
r916-Feb-04 9:32
r916-Feb-04 9:32 
GeneralRe: Fill 50% of a drawing with a color Pin
Heath Stewart16-Feb-04 9:45
protectorHeath Stewart16-Feb-04 9:45 
GeneralRe: Fill 50% of a drawing with a color Pin
r916-Feb-04 9:48
r916-Feb-04 9:48 
GeneralRe: Fill 50% of a drawing with a color Pin
Heath Stewart16-Feb-04 10:25
protectorHeath Stewart16-Feb-04 10:25 
GeneralRe: Fill 50% of a drawing with a color Pin
je_gonzalez16-Feb-04 12:54
je_gonzalez16-Feb-04 12:54 
QuestionHow to referenc functions in other code file Pin
klufy16-Feb-04 8:28
klufy16-Feb-04 8:28 
AnswerRe: How to referenc functions in other code file Pin
Colin Angus Mackay16-Feb-04 8:57
Colin Angus Mackay16-Feb-04 8:57 
GeneralRe: How to referenc functions in other code file Pin
klufy16-Feb-04 9:29
klufy16-Feb-04 9:29 

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.