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
This sample illustrates using a RichEdit control.
The source code is located at C:\Program Files (x86)\Softelvdm\SftPrintPreview OCX 1.0\Samples\VB6\PreviewRichEdit\Form1.frm or C:\Program Files\Softelvdm\SftPrintPreview OCX 1.0\Samples\VB6\PreviewRichEdit\Form1.frm (on 32-bit Windows versions).
Option Explicit
Private Sub AppExit_Click()
End
End Sub
Private Sub Form_Resize()
RichTextBox1.Move 0, 0, ScaleWidth, ScaleHeight
SftPrintPreview1.Move 0, 0, ScaleWidth, ScaleHeight
End Sub
Private Sub Form_Load()
RichTextBox1.LoadFile "SftPrintPreview.rtf"
' Connect the RichEdit control to the print preview control
SftPrintPreview1.ContentProviderCallbackX RichTextBox1.hWnd, SftPrintPreview1.RenderRichEditX, 0
End Sub
Private Sub SftPrintPreview1_PageSetupWanted()
SftPrintPreview1.PageSetup 0
End Sub
Private Sub SftPrintPreview1_HelpWanted(ByVal HelpName As String)
MsgBox ("Sorry, this sample doesn't offer a help file")
End Sub
Private Sub SftPrintPreview1_CloseWanted()
ViewRichEdit_Click
End Sub
Private Sub Preview_Click()
' Hide the RichEdit control
RichTextBox1.Enabled = False
RichTextBox1.Visible = False
' Show the print preview control
SftPrintPreview1.Enabled = True
SftPrintPreview1.Visible = True
SftPrintPreview1.SetFocus
' In case the tree control changed, we have to reformat everything
SftPrintPreview1.Restart restartSftPrintPreviewComplete
End Sub
Private Sub ViewRichEdit_Click()
' Hide the print preview control
SftPrintPreview1.Enabled = False
SftPrintPreview1.Visible = False
' Show the RichEdit control
RichTextBox1.Enabled = True
RichTextBox1.Visible = True
RichTextBox1.SetFocus
End Sub
Private Sub PrintDirect_Click()
SftPrintPreview1.PrintContents True, 0, False
End Sub
Private Sub PrintSetup_Click()
SftPrintPreview1.PrinterSetup 0
End Sub