Handle to Printer Device

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pete L

    #1

    Handle to Printer Device

    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



  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Handle to Printer Device

    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 PrintPageEventA rgs 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.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - nick(dot)paldin o=at=exisconsul ting<dot>com

    "Pete L" <PeteLibardoni@ crossmatch.net> wrote in message
    news:0f0e01c38c 3a$6dc08070$a00 1280a@phx.gbl.. .[color=blue]
    > 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
    >
    >
    >[/color]


    Comment

    Working...