Handle to Printer Device

  • Thread starter Thread starter Pete L
  • Start date Start date
P

Pete L

I am upgrading a VB6 program to C#. I need the equivelant
of the following VB6 statement, to pass to a 3rd party
control.

Printer.hDC

Thanks for the Help
 
Pete,

The model is different in .NET. You should be creating an instance of
the PrintDocument class and then calling the Print method on that. Once you
do that, it will call the OnPrintPage method which will be passed an
instance of the PrintPageEventArgs class. From that, you can use the
Graphics property, which you can then call the GetHdc method on it to get
the handle.

Hope this helps.
 
Back
Top