WindowControlOptions.DrawMethod Property

Gets or sets which message should be used to paint a control inside the PrintableComponentContainer.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v20.1.dll

Declaration

[DefaultValue(WinControlDrawMethod.UseWMPaint)]
public WinControlDrawMethod DrawMethod { get; set; }
<DefaultValue(WinControlDrawMethod.UseWMPaint)>
Public Property DrawMethod As WinControlDrawMethod

Property Value

Type Default Description
WinControlDrawMethod

UseWMPaint

The message that should be used to paint a control inside the PrintableComponentContainer.

Property Paths

You can access the WindowControlOptions.DrawMethod property from the following objects:

Object Type Path to DrawMethod
PrintableComponentContainer
.WindowControlOptions.DrawMethod

Examples

The code sample below creates a DataGridView control instance and adds this instance to a report. The sample specifies that the DataGridView control is printed as a bitmap image.

using System.Windows.Forms;
using DevExpress.XtraReports.UI;
// ...
// Create an XtraReport instance.
XtraReport report = new XtraReport() {
    Bands = {
        new DetailBand()
    }
};
// Create a DataGridView control instance.
DataGridView dataGridView = new DataGridView();
// Create a PrintableComponentContainer instance for the data grid.
PrintableComponentContainer printableComponentContainer = new PrintableComponentContainer();
// Place the data grid inside the printable component container.
printableComponentContainer.PrintableComponent = dataGridView;
// Specify that the WM_PRINT message is used to print the control inside the printable component container.
printableComponentContainer.WindowControlOptions.DrawMethod = WinControlDrawMethod.UseWMPrint;
// Specify that the control inside the printable component container is always printed as an image.
printableComponentContainer.WindowControlOptions.PrintMode = WinControlPrintMode.AsImage;
// Specify that the printed image is a bitmap, not a metafile.
printableComponentContainer.WindowControlOptions.ImageType = WinControlImageType.Bitmap;
// Add the printable component container to the report.
report.Bands[BandKind.Detail].Controls.Add(printableComponentContainer);
See Also