SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
Defines the callback that provides printable content.
VB.NET | object.ContentProviderCallback(ByVal Handle As Integer, ByVal CallbackPointer As VT_VOID, ByVal WorkAreaPointer As VT_VOID) |
VB | object.ContentProviderCallback(ByVal Handle As Long, CallbackPointer As VT_VOID, WorkAreaPointer As VT_VOID) |
C#.NET | void object.ContentProviderCallback(int Handle, void CallbackPointer, void WorkAreaPointer); |
VC++ | HRESULT object->ContentProviderCallback(long Handle, void* CallbackPointer, void* WorkAreaPointer); |
C | HRESULT object->raw_ContentProviderCallback(long Handle, void* CallbackPointer, void* WorkAreaPointer); |
object
Handle
A window handle describing the window to be printed or previewed. This value can be 0 if application-generated output is rendered using the RenderContent event.
CallbackPointer
A callback routine. This value can be 0 (NULL) if application-generated output is rendered using the RenderContent event. When rendering a RichEdit control, Handle defines the RichEdit control and CallbackPointer is set to the RenderRichEdit or RenderRichEditX property value to print and preview the RichEdit control. This CallbackPointer is of type SFTPRINTPREVIEW_DRAWINFOPROC, which is defined by SftPrintPreview/DLL and can be used to implement a callback function as required by SftPrintPreview/DLL (requires SftPrintPreview/DLL).
WorkAreaPointer
An application-defined value. This value is available during the RenderContent event using the RenderingWorkArea property.
The ContentProviderCallback method defines the callback that provides printable content.
This method is not supported for use with Visual Basic 6.0
The use of the ContentProviderCallback or ContentProviderCallbackX methods override settings defined using a prior call to the ContentProvider property.
The ContentProviderCallback or ContentProviderCallbackX methods are functionally equivalent, but use different data types.
RichEdit controls require the use of the RenderRichEdit or RenderRichEditX functions 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 ContentProviderCallback or ContentProviderCallbackX methods are used with a CallbackPointer value of 0. The RenderContent event is used to render pages. The ContentProvider property is not used
SftTree/DLL and SftTree/OCX 5.0 (and up) are rendered by setting the ContentProvider property to the window handle of a SftTree/DLL or SftTree/OCX control. The ContentProviderCallback or ContentProviderCallbackX methods are not used. 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.
Private Sub MenuExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuExit.Click Application.Exit() End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load AxSftPrintPreview1.Dock = DockStyle.Fill ' Use the RenderContent event to render pages AxSftPrintPreview1.ContentProviderCallback(0, IntPtr.Zero, IntPtr.Zero) Show() ' Show this form so we get the form and the messagebox at the same time MessageBox.Show("This example demonstrates application-generated output." & vbCr & vbLf & vbCr & vbLf & "It prints one bitmap and 50 lines of text a total of 20 times. " & _ "The included source code illustrates how an application can print one page at a time, with an easy " & _ "mechanism to keep track of restart positions.") End Sub
Application.Exit(); } private void Form1_Load(object sender, System.EventArgs e) { axSftPrintPreview1.Dock = DockStyle.Fill; // Use the RenderContent event to render pages axSftPrintPreview1.ContentProviderCallback(0, IntPtr.Zero, IntPtr.Zero); Show(); // Show this form so we get the form and the messagebox at the same time MessageBox.Show("This example demonstrates application-generated output.\r\n\r\nIt prints one bitmap and 50 lines of text a total of 20 times. " + "The included source code illustrates how an application can print one page at a time, with an easy " + "mechanism to keep track of restart positions."); }
CRect rect; GetClientRect(&rect); m_Preview1.MoveWindow(0, 0, rect.Width(), rect.Height()); m_vPrintPreview1 = m_Preview1.GetControlUnknown(); ASSERT(m_vPrintPreview1 != NULL); // Use the RenderContent event to render pages m_vPrintPreview1->ContentProviderCallback(0, NULL, NULL); ShowWindow(SW_MAXIMIZE); UpdateWindow(); MessageBox(_T("This example demonstrates application-generated output.\r\n\r\nIt prints one bitmap and 50 lines of text a total of 20 times. " "The included source code illustrates how an application can print one page at a time, with an easy " "mechanism to keep track of restart positions."), _T("SftPrintPreview/OCX"));
See Also SftPrintPreview Object | Object Hierarchy