WinControlContainer.DrawMethod Property

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

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v20.2.dll

Declaration

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

Property Value

Type Default Description
WinControlDrawMethod

UseWMPaint

The message that should be used to paint a control placed in the WinControlContainer.

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 WinControlContainer instance for the data grid.
WinControlContainer winControlContainer = new WinControlContainer();
// Place the data grid inside the WinControlContainer.
winControlContainer.WinControl = dataGridView;
// Specify that the WM_PAINT message is used to print the control inside the WinControlContainer.
winControlContainer.DrawMethod = WinControlDrawMethod.UseWMPaint;
// Specify that the control inside the WinControlContainer is always printed as an image.
winControlContainer.PrintMode = WinControlPrintMode.AsImage;
// Specify that the printed image is a bitmap, not a metafile.
winControlContainer.ImageType = WinControlImageType.Bitmap;
// Specify that the control should synchronize its bounds with the WinControlContainer's bounds.
winControlContainer.SyncBounds = true;
// Add the printable component container to the report.
report.Bands[BandKind.Detail].Controls.Add(winControlContainer);
See Also