Skip to content

PrintText Method

Description

Prints the current Syntax Edit view.

Syntax

Public Sub PrintText( _
    ByVal [lHDC](#) As Integer _
)

Parameters

  • lHDC: A device context for a Printer object. Use 0 to let the Syntax Edit auto-detect printer settings and display a dialog for printing.

Remarks

With a CommonDialog control, the CommonDialog.hDC property returns a device context for the printer selected in the Print dialog box when the cdlReturnDC flag is set. See the sample below for more on how to do this.

Example

This sample illustrates how to print the current Syntax Edit view.

' Printing using the default printer dialog  
wndSyntaxEdit.PrintText 0  

' Printing using the CommonDialog Control  
On Error Resume Next  

With dlgCommonDialog  
    .DialogTitle = "Print"  
    .CancelError = True  
    .Flags = cdlPDReturnDC + cdlPDNoPageNums  
    .ShowPrinter  
    If Err <> MSComDlg.cdlCancel Then  
        wndSyntaxEdit.PrintText .hDC  
    End If  
End With  

See Also

SyntaxEdit Control


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.