.NET Framework Class Library
PageSettings.SetHdevmode Method

Copies relevant information to the PageSettings from the specified DEVMODE structure.

[Visual Basic]
Public Sub SetHdevmode( _
   ByVal hdevmode As IntPtr _
)
[C#]
public void SetHdevmode(
 IntPtr hdevmode
);
[C++]
public: void SetHdevmode(
 IntPtr hdevmode
);
[JScript]
public function SetHdevmode(
   hdevmode : IntPtr
);

Parameters

hdevmode
The handle to a Win32 DEVMODE structure.

Exceptions

Exception Type Condition
ArgumentException The printer handle is invalid.
InvalidPrinterException The printer named in the PrinterSettings.PrinterName property does not exist or there is no default printer installed.

Remarks

Use this method to copy relevant information in a DEVMODE structure to the PageSettings.

To copy information from the PageSettings to a DEVMODE, call CopyToHdevmode.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

PageSettings Class | PageSettings Members | System.Drawing.Printing Namespace | CopyToHdevmode

Page view tracker