VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Shows how to set Up the RichTextBox Control for WYSIWYG Printing

Anonymous  (267 Submissions)   Miscellaneous   Visual Basic 5.0   Unknown Difficulty   Wed 19th May 1999   Mon 8th February 2021

Shows how to set Up the RichTextBox Control for WYSIWYG Printing

API Declarations


Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Private Type CharRange
cpMin As Long ' First character of range (0 for start of doc)
cpMax As Long ' Last character of range (-1 for end of doc)
End Type

Private Type FormatRange
hdc As Long ' Actual DC to draw on
hdcTarget As Long ' Target DC for determining text formatting
rc As Rect ' Region of the DC to draw to (in twips)
rcPage As Rect ' Region of the entire DC (page size) (in twips)
chrg As CharRange ' Range of text to draw (see above declaration)
End Type

Private Const WM_USER As Long = &H400
Private Const EM_FORMATRANGE As Long = WM_USER + 57
Private Const EM_SETTARGETDEVICE As Long = WM_USER + 72
Private Const PHYSICALOFFSETX As Long = 112
Private Const PHYSICALOFFSETY As Long = 113

Private Declare Function GetDeviceCaps Lib "gdi32" ( _
ByVal hdc As Long, ByVal nIndex As Long) As Long
Private Declare Function SendMessage Lib "USER32" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal msg As Long, ByVal wp As Long, _
lp As Any) As Long
Private Declare Function CreateDC Lib "gdi32" Alias "CreateDCA" _
(ByVal lpDriverName As String, ByVal lpDeviceName As String, _
ByVal lpOutput As Long, ByVal lpInitData As Long) As Long

Rate Shows how to set Up the RichTextBox Control for WYSIWYG Printing (2(2 Vote))
Shows how to set Up the RichTextBox Control for WYSIWYG Printing.bas

Shows how to set Up the RichTextBox Control for WYSIWYG Printing Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters