Hide

SftPrintPreview/OCX 1.0 - ActiveX Print Preview Control

Display
Print

SftPrintPreview.ContentProvider Property

Defines the control that provides printable content.

Syntax

Get

VB.NETHandle = object.ContentProvider As Integer
VBHandle = object.ContentProvider As Long
C#.NETint Handle = object.ContentProvider;
VC++long Handle = object->ContentProvider;
long Handle = object->GetContentProvider();
CHRESULT object->get_ContentProvider(long* Handle);

Put

VB.NETobject.ContentProvider = Handle As Integer
VBobject.ContentProvider = Handle As Long
C#.NETint object.ContentProvider = Handle;
VC++long object->ContentProvider = Handle;
void object->PutContentProvider(long Handle);
CHRESULT object->put_ContentProvider(long Handle);

object

A SftPrintPreview object.

Handle

Defines the control that provides printable content.

Comments

The ContentProvider property defines the control that provides printable content.

The window defined using the ContentProvider property must support printing and print preview using the SFTPRINTPREVIEW_CONTENTWINDOWMESSAGE protocol. This protocol is defined by the product SftPrintPreview/DLL.

SftTree/DLL and SftTree/OCX 5.0 (and up) support this protocol and can be rendered by setting the ContentProvider property to the window handle of a SftTree/DLL or SftTree/OCX control. The DataProvider property is also supported for use with SftTree/DLL or SftTree/OCX controls. All rendering is provided by SftTree/DLL or SftTree/OCX through the SFTPRINTPREVIEW_CONTENTWINDOWMESSAGE protocol. The RenderContent event is not used.

The use of the ContentProvider property overrides settings defined using a prior call to the ContentProviderCallback or ContentProviderCallbackX methods.

RichEdit controls require the use of the RenderRichEdit or RenderRichEditX property values as a CallbackPointer for the ContentProviderCallback or ContentProviderCallbackX methods. The ContentProvider property is not used. The RenderRichEdit function, provided by SftPrintPreview/OCX, provides all rendering support for RichEdit controls. The RenderContent event is not used.

For application-generated output, the ContentProvider property is not used. The ContentProviderCallback or ContentProviderCallbackX methods are used with a CallbackPointer value of 0. The RenderContent event is used to render pages.

Examples

VB.NET

    AxSftTree1.Items.RecalcHorizontalExtent() ' update horizontal scroll bar

    AxSftTree1.get_Item(0).Selected = True
    AxSftTree1.Items.Current = 0

    CopyImageFromCurrentItem()

    ' Connect the tree control to the print preview control
    AxSftPrintPreview1.ContentProvider = AxSftTree1.hWnd

End Sub

Private Sub AxSftTree1_ItemClick(ByVal sender As Object, ByVal e As AxSftTreeLib65._DSftTreeEvents_ItemClickEvent) Handles axSftTree1.ItemClick
    Dim AreaType As SftTreeAreaTypeConstants
    AreaType = e.areaType
    If AreaType = SftTreeAreaTypeConstants.constSftTreeExpandAll Then

VB6

        .Item(0).Selected = True
        .Items.Current = 0

        CopyImageFromCurrentItem

    End With

    ' Connect the tree control to the print preview control
    SftPrintPreview1.ContentProvider = SftTree1.hWnd
End Sub

Private Sub SftTree1_ItemClick(ByVal ItemIndex As Long, ByVal ColIndex As Integer, ByVal AreaType As Integer, ByVal Button As Integer, ByVal Shift As Integer)
    Dim Area As SftTreeAreaTypeConstants
    Area = AreaType
    If Area = constSftTreeExpandAll Then
        SftTree1.Item(ItemIndex).Expand True, True

C#

    axSftTree1.Items.RecalcHorizontalExtent(); // update horizontal scroll bar

    axSftTree1.get_Item(0).Selected = true;
    axSftTree1.Items.Current = 0;

    CopyImageFromCurrentItem();

    // Connect the tree control to the print preview control
    axSftPrintPreview1.ContentProvider = axSftTree1.hWnd;

}

private void axSftTree1_ItemClick(object sender, AxSftTreeLib65._DSftTreeEvents_ItemClickEvent e)
{
    SftTreeAreaTypeConstants areaType = (SftTreeAreaTypeConstants) e.areaType;
    if (areaType == SftTreeAreaTypeConstants.constSftTreeExpandAll)

C++

    m_vTree->Items->RecalcHorizontalExtent(); // update horizontal scroll bar

    m_vTree->Item[0]->Selected = VARIANT_TRUE;
    m_vTree->Items->Current = 0;

    CopyImageFromCurrentItem();

    // Connect the tree control to the print preview control
    m_vPrintPreview1->ContentProvider = m_vTree->hWnd;

    ShowWindow(SW_MAXIMIZE);

    return TRUE;  // return TRUE  unless you set the focus to a control
}

void CSftPrintPreviewDlg::OnSize(UINT nType, int cx, int cy)

See Also SftPrintPreview Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.