Introduction

Copyright © Erez Business Softwares Ltd. All rights reserved. January 2002
Erez Business Softwares Ltd.
E-Mail: erezsoft@erezsoft.co.il
Web Site: http://www.erezsoft.co.il
Web Page of the Control: http://www.erezsoft.co.il/erez_printpreview.shtml
Welcome to Erez Print Preview Controls for VB6.

We have 2 controls as follows:
ErezPP1_LTR
This control is Left To Right direction and will work on any platform of Windows 32 BIT.

ErezPP1_RTL
This control is Right To Left direction and will work only on bidirectional platform of Windows 32 BIT as Hebrew Ena/Loc or Arabic Ena/Loc.

The controls were designed for Visual Basic 6 to give developers an easy tool to make print and preview of their software especially for business softwares!!. It worth to take a look of those controls. Get a free trial version copy of our controls. The trial version is fully functional but will work for 30 business days from the date of its first installation as well as having a nag screen. After 30 days you will no longer be able to use the control unless you register it.
If you have any suggestions or ideas for new features that you would like to see included in a future version write us at: ErezPrintPreview@erezsoft.co.il

"ErezPP" hereafter means ErezPP1_LTR and/or ErezPP1_RTL

"Erezsoft" hereafter means Erez Business Softwares Ltd.


 Copyright Notice and Trademarks
Copyright Notice
All rights reserved. No part of this document may be reproduced or transmitted, without the expressed written permission of Erezsoft. Information in this document is subject to change without notice. © 2002 Erez Business Softwares Ltd. ® All rights reserved.

Trademarks
Erezsoft and ErezPP1_LTR and ErezPP1_RTL are trademarks of Erez Business Softwares Ltd in Israel and/or other countries.
Microsoft, Windows, and other names of Microsoft products referenced herein are trademarks or registered trademarks of Microsoft Corporation. All other product and company names mentioned herein are the trademarks of their respective owners.


 Installing ErezPP (ErezPP1_LTR and/or ErezPP1_RTL)
How to install the control
To install each control, use the SETUP.EXE utility that you downloaded from our web site.
Note: Always use the SETUP.EXE utility to install ErezPP OCX on new computers and register it in order to prevent message of unlicensed control.

Adding the control to project
Before you can use the control in your application, you must add it to your project. select in Visual Basic the ErezPP OCX Control from the list of the toolbox and drop it on a form.

Distribute applications with ErezPP control
In order to distribute applications that you created with the ErezPP OCX, you must install and register the OCX on the user's computer. Fortunately the Setup Wizard provided with Visual Basic does it for you. Please refer to the Visual Basic manual for details.
Also, make sure that the license file "ErezPP1LTR.lic" or "ErezPP1RTL.lic" is included with your distribution files. The VB Package & Deployment will include that file automatically with your distribution file.
The OCX and Lic files have to be installed on your end user WINDOWS\SYSTEM folder.
If you install your software on Win95 platform then you have to put also the file scrrun.dll on your end user WINDOWS\SYSTEM folder.


 Registering ErezPP (ErezPP1_LTR and/or ErezPP1_RTL) OCX
How to register the control
In order to be a licensed user enter the Registration Name and Registration Key provided to you by E-MAIL exactly as it is printed and click REGISTER to complete the registration process.
You can get the registration form by 2 ways:
1. doublclick the about property at your properties section.
2. if the control is not licensed then every time you initialize it you get an Erezsoft banner and then you will have the option to register it.

Please do not modify the file "ErezPP1LTR.lic" or "ErezPP1RTL.lic" which added to your windows\system folder after registering, otherwise the registering will be disrupted.

Why it's worth your while registering
As a registered user you have the following benefits:
1. You are entitled to get support by E-MAIL for 1 year starting the date of registering.
2. You may download from our web site, free of charges all the future versions of ErezPP1LTR and/or ErezPP1RTL control.
3. You and your end users will get rid of the Erezsoft banner whenever it is loaded.
4. You and your end users will not have the restriction of 30 days.


General remarks constant

 General remarks
The constants presented in this group used for some Properties or Methods of the controls.
Constants, which used once for some Property or Method, are not presented here but presented at the topic, which uses the constants.


 AfterPrintType constant
Includes constants of jumping to next line after printing to the control.

The setting constants of AfterPrintType are as follows:
Constant | Value | Description
A1_StayWhereYouAre | 1 | After printing the text, the control lives the cursor where it is.
A2_JumpToNextLine | 2 | After printing the text, the control moves the cursor to the next line. The "next line" is considered by the scaleheight of the control.


 AlignType constant
Sets the alignment of printing text or graphic on the control.

The setting constants of AlignType are as follows:
Constant | Value | Description
A0_AlignNone | 0 | Ignore alignment and use the present cursor as the starting point for printing text or graphic.
A1_AlignRight | 1 | Align the text or graphic to the right edge of the control.
A2_AlignCenter | 2 | Center the text or graphic at the control. this is horizontal centering and considers the right and left margin of the control.
A3_AlignLeft | 3 | Align the text or graphic to the left edge of the control.


 BackColor Property
Returns or sets the background color of the control.

Syntax
form.ErezPP.BackColor=color value

Remarks
This property can be changed also by the end user to meet his favourite.


 CurrentX Property
Returns or sets the horizontal coordinates of the control for printing or drawing method.

Syntax
form.ErezPP.CurrentX = { number }

Remarks
This property represents number of twips from the left edge when you use the LTR control or number of twips from the right edge when you use the RTL control.

Data Type
Single

Default Value
0


CurrentY

 CurrentY Property
Returns or sets the vertical coordinates of the control (in Twips) for printing or drawing method.
This property represents number of twips from the top edge of the control.

Syntax
form.ErezPP.CurrentY = { number }

Data Type
Single

Default Value
0
represents the top edge of the control.


 DontConsiderForCenter Property
Force the control to stop neasure centering a page even if tfCenterPages is True.

Syntax
form.ErezPP.DontConsiderForCenter = { True/False }

Remarks
setting this property to True causes the control to stop measure centering a page even if tfCenterPages set to True. Sometimes you want to center all pages but you want to avoid the control from measuring the centering when you print long line or text and don't want them to affect the measurement of centering. Define DontConsiderForCenter=True when you want the control to stop measurement of centering, and give back the False value to continue measurement of centering.

Data Type
Boolean

Default Value
False


 dontPrintPageNumber Property
Returns or sets Boolean value whether the control prints the page number for each page.

If the dontPrintPageNumber property is set to True, then the control would not print the page number at every page.

Syntax
form.ErezPP.dontPrintPageNumber = { True/False }

Remarks
Even if the dontPrintPageNumber property is set to True, the control still considers the pages and list them inside the combo box. It just dose not print the page number.

Data Type
Boolean

Default Value
False


 Font Property
Returns or sets the VB standard Fonts attribute.
The control gives you direct access to most of Font attribute as FontBold or Fontunderline etc. Use this Property to define other attribute as Charset.

Syntax
form.ErezPP.Font.someProperty = { True/False value }


 FontBold Property
Returns or sets the Bold attribute of the font used to display text and graphic in the control.

Syntax
form.ErezPP.FontBold = { True/False }

Remarks
Changing this property affects the display text and graphic in the control from now on.

Data Type
Boolean

Default Value
False


 FontItalic Property
Returns or sets the Italic attribute of the font used to display text and graphic in the control.

Syntax
form.ErezPP.FontItalic = { True/False }

Remarks
Changing this property affects the display text and graphic in the control from now on.

Data Type
Boolean

Default Value
False


 Fontname Property
Returns or sets the name of the font used to display text and graphic in the control.

Syntax
form.ErezPP.Fontname = { True/False }

Remarks
Changing this property forces the control to use the new font from now on.

Data Type
Boolean

Default Value
False


 Fontsize Property
Returns or sets the size of the font used to display text and graphic in the control.

Syntax
form.ErezPP.Fontsize = { Single value }

Remarks
Changing this property forces the control to use the new size of the font from now on.

Data Type
Single

Default Value 8
False


 FontTransparent Property
Returns or sets a Boolean value that determines whether background text/graphic on the control are displayed.

Syntax
form.ErezPP.FontTransparent = { True/False }

Remarks
Changing this property affects the display text and graphic in the control from now on.

Data Type
Boolean

Default Value
False


 Fontunderline Property
Returns or sets the Underline attribute of the font used to display text and graphic in the control.

Syntax
form.ErezPP.Fontunderline = { True/False }

Remarks
Changing this property affects the display text and graphic in the control from now on.

Data Type
Boolean

Default Value
False


 ForeColor Property
Returns or sets the foreground color used to display text and graphic in the control.

Syntax
form.ErezPP.ForeColor = { Value or constant color }

Remarks
The constant color is the VB constant color RGB or QBColor.

Data Type
Long integer

Default Value
0


 gtPrWidth Property
Get Single value information about the width (in Twips) of the control including LeftMargin and RightMargin.

Syntax
x!=form.ErezPP.gtPrWidth

Remarks
This property is read only and can be used only at run-time.
When no printer is connected to the computer the default value is 11952 Twips which equals to width size paper A4.
If a printer is connected to the computer then gtPrWidth=Printer.Width


 gtPrWidth_Net Property
Get Single value information about the width (in Twips) of the control excluding LeftMargin and RightMargin.

Syntax
x!=form.ErezPP.gtPrWidth_Net

Remarks
This property is read only and can be used only at run-time. It reflects the net printed area.
When no printer is connected to the computer the default value is 11952 Twips which equals to width size paper A4 minus LeftMargin and RightMargin.
If a printer is connected to the computer then gtPrWidth_Net=Printer.Width minus LeftMargin and RightMargin.


 gtPrHeight Property
Get Single value information about the Height (in Twips) of the control including TopMargin and BottomMargin.

Syntax
x!=form.ErezPP.gtPrHeight

Remarks
This property is read only and can be used only at run-time.
When no printer is connected to the computer the default value is 16834 Twips which equals to height size paper A4.
If a printer is connected to the computer then gtPrHeight=Printer.Height.


 gtPrHeight_Net Property
Get Single value information about the Height (in Twips) of the control excluding TopMargin and BottomMargin.

Syntax
x!=form.ErezPP.gtPrHeight_Net

Remarks
This property is read only and can be used only at run-time. It reflects the net printed area.
When no printer is connected to the computer the default value is 16834 Twips which equals to height size paper A4 minus TopMargin and BottomMargin.
If a printer is connected to the computer then gtPrHeight_Net=Printer.Height minus TopMargin and BottomMargin.


 gtAfterPage Property
Notes if we have just finished a printed page and the cursor exists on the first row of new page, usually the first row is the TopMargin.

Syntax
form.ErezPP.gtAfterPage = { True/False }

Remarks
This is important information. Suppose last page included some topic, which continue at the new page. Now probably you want to print at the top of the new page the title of the recent topic.

Data Type
Boolean

Default Value
False


 Header Property
Defines if the control includes header at the top of every page.

Syntax
form.ErezPP.Header = { True/False }

Remarks
This property used to determine if the control includes a header at the top of each page. If this property set to True then the Method PrintHeader causes the header to be printed.


 ScaleHeight Property
Get Single value information (in Twips) about the vertical units of measurement of the control.

Syntax
x!=form.ErezPP.ScaleHeight

Remarks
This property is read only.
When no printer is connected to the computer the default value is 16171 Twips.
If a printer is connected to the computer then the ScaleHeight = Printer.ScaleHeight.


 ScaleWidth Property
Get Single value information (in Twips) about the horizontal units of measurement of the control.

Syntax
x!=form.ErezPP.ScaleWidth

Remarks
This property is read only.
When no printer is connected to the computer the default value is 11150 Twips.
If a printer is connected to the computer then the ScaleWidth = Printer.ScaleWidth.


 tfPrintFooter1 Property
Returns or sets Boolean value to allow the control to print the footer Footer1

Syntax
form.ErezPP.tfPrintFooter1 = { True/False }

Remarks
You can switch between True and False in order to let the control printing the Footer1 on some pages or to avoid printing the Footer1 on other pages.

Data Type
Boolean

Default Value
False


 Zoom Property
Returns or sets the Zoom of the preview.

Syntax
form.ErezPP.Zoom = { New_Zoom As ZoomType }

Remarks
The default of the zoom is 100%. End user can change zoom preview at any time. This property gives developers the ability to set zoom before forming pages.

Data Type
Integer
you can get the value when you type zoom. by ZoomType Enum. The constants of ZoomType are as follows:
Constant | Value | % | Constant | Value | %
Z00_20percent | 0 | 20 | Z10_120percent | 10 | 120
Z01_30percent | 1 | 30 | Z11_130percent | 11 | 130
Z02_40percent | 2 | 40 | Z12_140percent | 12 | 140
Z03_50percent | 3 | 50 | Z13_150percent | 13 | 150
Z04_60percent | 4 | 60 | Z14_160percent | 14 | 160
Z05_70percent | 5 | 70 | Z15_170percent | 15 | 170
Z06_80percent | 6 | 80 | Z16_180percent | 16 | 180
Z07_90percent | 7 | 90 | Z17_190percent | 17 | 190
Z08_100percent | 8 | 100 | Z18_200percent | 18 | 200
Z09_110percent | 9 | 110 |  |  |

Default Value
8 - points to 100%


 centerMixedLanguages Method

Syntax
form.ErezPP.centerMixedLanguages(TXT As String)

Remarks
Center complex title which consists of few formed titles.
if we want to center only 1 formed title then we may use the method centerIT. The method centerMixedLanguages causes the control to compute all the formed titles together to 1 title and to center it. This method is very useful for Right To Left languages as Hebrew/Arabic, for example to center formed text which consists of those languages and English which has Left To Right direction.

TXT is the text of the first title in the complex title.
After this method, all the titles which have the same CurrentY are joined together by the control in order to center it.
For illustration please see the example.


 CenterIT Method
Center text on the control.

Syntax
form.ErezPP.centerIT(TXT As String, Entr As AfterPrintType)

Remarks
This method used to print text on the control and center it horizontally. The centering is computed between left margin and right margin.

TXT is the text you want to be printed on the control. the font or color of the text as defined before using LeftIT.
Entr As AfterPrintType - you can see at the topic AfterPrintType


 Change properties of inner controls
Here are the properties of the controls inside ErezPP control that may be changed by you, like changing the caption of buttons to your local language or changing their fonts etc.

Buttons of the toolbar on the top of the control
You can change captions and Fontbold of controls in the toolbar
if you want to change the Fontname of the buttons do it as follows:
form.ErezPP.Fontname_Buttons(TXT As String)

the buttons in details as follows:

form.ErezPP.fxCaptionButton_Close(TXT As String)
form.ErezPP.fxFontbold_Button_Close(BL As Boolean)
form.ErezPP.fxCaptionButton_Print(TXT As String)
form.ErezPP.fxFontbold_Button_Print(BL As Boolean)
form.ErezPP.fxCaptionButton_First_F5(TXT As String)
form.ErezPP.fxFontbold_Button_First(BL As Boolean)
form.ErezPP.fxCaptionButton_Previous_F6(TXT As String)
form.ErezPP.fxFontbold_Button_Previous(BL As Boolean)
form.ErezPP.fxCaptionButton_Next_F7(TXT As String)
form.ErezPP.fxFontbold_Button_Next(BL As Boolean)
form.ErezPP.fxCaptionButton_Last_F8(TXT As String)
form.ErezPP.fxFontbold_Button_Last(BL As Boolean)
form.ErezPP.fxCaptionButton_Search_F3(TXT As String)
form.ErezPP.fxFontbold_Button_Search(BL As Boolean)
form.ErezPP.fxCaptionButton_Continue_Search_F3(TXT As String)
form.ErezPP.fxFontbold_Button_Continue_Search(BL As Boolean)

The frame of printing parameters
You can change captions of the frame and the controls inside it

the buttons in details as follows:

form.ErezPP.fxCaptionLblPrinterName(TXT As String)

form.ErezPP.fxCaptionLblCopies(TXT As String)
form.ErezPP.fxCaptionLblQuality(TXT As String)
form.ErezPP.fxCaptionLblZoomPrinting(TXT As String)
form.ErezPP.fxCaptionLblFromPage(TXT As String)
form.ErezPP.fxCaptionLblToPage(TXT As String)
form.ErezPP.fxCaptionFraPrinter(TXT As String)
form.ErezPP.fxCaptionFraPrinterCmdOK(TXT As String)
form.ErezPP.fxCaptionFraPrinterCmdCancel(TXT As String)
You can change the first 4 text of the Quality parameters ComboBox: Draft, High, Low, and Medium quality as follows:

form.ErezPP.fxTextComboQuality_Draft(TXT As String)
form.ErezPP.fxTextComboQuality_High(TXT As String)
form.ErezPP.fxTextComboQuality_Low(TXT As String)
form.ErezPP.fxTextComboQuality_Medium(TXT As String)
You can change the 2 text of the Zoom parameters ComboBox: Defined, Ignore as follows:

form.ErezPP.fxTextComboZoom_Defined(TXT As String)
form.ErezPP.fxTextComboZoom_Ignore(TXT As String)
The frame of finding text at the preview
You can change captions of the frame and the controls inside it

the buttons in details as follows:

form.ErezPP.fxCaptionFraSearch(TXT As String)
form.ErezPP.fxCaptionLblSearch(TXT As String)
form.ErezPP.fxCaptionCmdSearch(TXT As String)
form.ErezPP.fxCaptionCmdCancelSearch(TXT As String)
Remarks
Changing this property affects the display text and graphic in the control from now on.

Data Type
Boolean

Default Value
False


 checkMin1 Method
used to check if the cursor exists on a line, which is over the minimum to print, so the control prints the page number and jump to next line.

Syntax
form.ErezPP.checkMin1

Remarks
Before understanding this method we have to know about some values connected to it:
maxP is Single value representing the maximum currentY (in Twips) to be printed.
maxP is also the currentY place to print the page number.
The control measures this value: maxP = Printer.Height - BottomMargin - 425
as far as the BottomMargin is greater the maxP is smaller.
minP = maxP - 1800 (in Twips).
reduceTwips is Single value represents by default 1000 Twips and may be changed by you.
put this method after every print method that causes the cursor to jump to the next line.
If the cursor is in line which is greater then minP - reduceTwips then it jumps to the next line, so the value reduceTwips affects the currentY place which the cursor jump to next page.
Sometimes you don't want to put this checking and prefer that 1 or 2 more lines will be printed before the control goes to newpage. In this case you should not use the checkMin1 method.
If you need few more lines to be printed then use checkMin2 method instead.


 checkMin2 Method
Used to check if the cursor exists on a line that is over the minimum to print, so the control prints the page number and jump to next line.

Syntax
form.ErezPP.checkMin1

Remarks
Before understanding this method we have to know about some values connected to it:
maxP is Single value representing the maximum currentY (in Twips) to be printed.
maxP is also the currentY place to print the page number.
The control measures this value: maxP = Printer.Height - BottomMargin - 425
as far as the BottomMargin is greater the maxP is smaller.
minP = maxP - 1800 (in Twips).
Put this method after every print method, which causes the cursor to jump to the next line.
If the cursor is in line that is greater then minP then it jumps to the next line.
Sometimes you don't want to put this checking and prefer that 1 or 2 more lines will be printed before the control goes to newpage. In this case you should not use the checkMin2 method.
This method let you have some more printed lines comparing to checkMin1 method.


 Footer1Right Method
Used to define footer of 2 lines.

Syntax
form.ErezPP.Footer1Right(kdOneToFour As Footer1Number, TXT As String, R1FontName$, R1FontSize!, R1FontBold As Boolean, R1FontItalic As Boolean, R1FontUnderline As Boolean, R1Forecolor&)

Remarks
The footer is of 1 line or 2 lines. The first line footer is printed on the same line of the printed page number at the bottom of the page. The second line is printed under the first footer. Each of the 2 lines consists from 2 parts: the right part, which is right aligned, and the left part which is left aligned. The footer is printed by the control on each printed page.

The setting parameters of Footer1Right are as follows:
Constant | Description
kdOneToFour As Footer1Number | Defines the 4 title of the footer. The setting parameter of kdOneToFour are as follows:
 | Constant | Value | Description
 | N1_RightFooterOfPagenumberLine | 1 | The first title which is the right footer of the first line.
 | N2_LeftFooterOfPagenumberLine | 2 | The second title which is the left footer of the first line.
 | N3_RightFooterOfSecondLine | 3 | The third title which is the right footer of the second line.
 | N4_LeftFooterOfSecondLine | 4 | The forth title which is the left footer of the second line.
TXT | String value of the title.
R1FontName | String value, which represents the FontName of the title.
R1FontSize | Single value, which represents the FontSize of the title.
R1FontBold | Boolean value which represents if the Font of the title is Bold.
R1FontItalic | Boolean value which represents if the Font of the title is Italic.
R1FontUnderline | Boolean value which represents if the Font of the title is Underlined.
R1Forecolor | Long integer value, which represents the Forecolor of the title.


 fxDefaultMargins Method
This method let you set the default margins with cm value before forming the pages.

Syntax
form.ErezPP.fxDefaultMargins(lMargin As Single, rMargin As Single, tMargin As Single, bMargin As Single)

Remarks
lMargin is LeftMargin, rMargin is RightMargin, tMargin is TopMargin and bMargin is BottomMargin.
End user may set the margins equal to the defaults. The defaults of the control are as follows:
LeftMargin = 1.5 cm
RightMargin = 1.5 cm
TopMargin = 1.5 cm
BottomMargin = 3.5 cm
The above defaults may be changed by you with the fxDefaultMargins method.


 fxMargins Method
This method let you set margins with cm value before forming the pages.

Syntax
form.ErezPP.fxMargins(lftMargin As Single, rtMargin As Single, tpMargin As Single, btmMargin As Single)

Remarks
lftMargin is LeftMargin, rtMargin is RightMargin, tpMargin is TopMargin and btmMargin is BottomMargin.


 fxNumberOfFirstPage Method
This method let you set an Integer value which represents the number of the first page which will be printed by the control.

Syntax
form.ErezPP.fxreduceTwips(X%)

Remarks
If the first page is number 1 then you don't need this method because the default by the control is 1.


 fxPageNumber Method
This method let you set the font and color for page number.

Syntax
form.ErezPP.fxPageNumber(pFontName As String, pFontSize As Single, pFontBold As Boolean, pFontUnderline As Boolean, pFontItalic As Boolean, pForecolor As Long)

Remarks
If you don't set this then the default of the control is:
fontname="ms sans serif"
size=14
bold=false
underline=false
italic=false
color=black

If you want that every page number will have font and color defined by you then you should do like this example:
form.ErezPP.fxPageNumber "times new roman", 14, True, False, False, vbRed
The above command line set the font and color of page number as follows:
FontName="times new roman"
FontnSize=14
FontnBold=True
FontnUnderline=False
FontnItalic=False
Forecolor=Red

it is important to note that you can do the method only once after you initialized the control!


 fxPrintingChars Method
Used to draw a string which consist of combination of the same char.

Syntax
form.ErezPP.fxPrintingChars(startTwipsPoint!, endTwipsPoint!, ASCIICode%, DR As DirectionOfPrintCharsType, Entr As AfterPrintType, cKind As WhereToPrintChars)

Remarks
fxPrintingChars let you drawing a string which consist of combination of the same char. The string can be printed horizontally or vertically.

The setting parameters of fxPrintingChars are as follows:
Constant | Description
startTwipsPoint, endTwipsPoint | Single values indicating the starting point and endpoint (in Twips) of the string.
ASCIICode | Integer value indicating the ASCII number of the char to be printed. for example, if you want to print the char "=" then ASCIICode is 61 etc.
DR As DirectionOfPrintCharsType |  | Set the direction of the printing char. The setting parameter of DR are as follows:
 |  | Constant | Value | Description
 |  | PrintHorizontal | 0 | Print the string horizontally.
 |  | PrintVertical | 1 | Print the string vertically.
Entr As AfterPrintType |  | The setting parameter of AfterPrintType are as follows:
 |  | Constant | Value | Description
 |  | A1_StayWhereYouAre | 1 | After printing the text, the control lives the cursor where it is.
 |  | A2_JumpToNextLine | 2 | After printing the text, the control moves the cursor to the next line. The ScaleHeight of the control considers the "next line".
cKind As WhereToPrintChars |  | Gives the ability to define if the string will be printed from startTwipsPoint to endTwipsPoint or to other fix places. The setting parameter of cKind are as follows:
 |  | Constant | Value | Description
 |  | K0_StartAndEnd_ PointAsDefined | 0 | Print the string as defined from startTwipsPoint to endTwipsPoint.
 |  | K1_FromLeftmargin_ ToRightmargin | 1 | Print the string from Leftmargin to Rightmargin of the control, from the CurrentX point of the cursor.
 |  | K2_StartAndEndPoint_ AsStringOfLastRow | 2 | startTwipsPoint and endTwipsPoint are equal to startpoint and endpoint of the string printed on previous row. This is good when you want to print title and to draw upon or under it a string of char. It is also useful to print underlined title by printing the title and then using this method to print chr(175) under the title.


 fxPrintWithoutPreview Method
Print without preview.

Syntax
form.ErezPP.fxPrintWithoutPreview(tfPrintWithoutPreview As Boolean, QL As stPrinterQuality)

Remarks
setting tfPrintWithoutPreview to True causes the control to send the formed pages directly to the printer without activating the Preview.
The constants of stPrinterQuality are as follows:
Constant | Value | Quality Mode | Constant | Value | Quality Mode
Q00_Draft | 0 | Draft | Q06_Dpi_900 | 6 | Dpi_900
Q01_Low_Resolution | 1 | Low_Resolution | Q07_Dpi_1200 | 7 | Dpi_1200
Q02_Medium_Resolution | 2 | Medium_Resolution | Q08_Dpi_1500 | 8 | Dpi_1500
Q03_High_Resolution | 3 | High_Resolution | Q09_Dpi_1800 | 9 | Dpi_1800
Q04_Dpi_300 | 4 | Dpi_300 | Q10_Dpi_2100 | 10 | Dpi_2100
Q05_Dpi_600 | 5 | Dpi_600 | Q11_Dpi_2400 | 11 | Dpi_2400

Default Value
0 - Draft


 fxProporional_CurrentY Method
This method let you determine that the CurrentY of next printing will be proprtional to the CurrentY of page number.

Syntax
form.ErezPP.fxProporional_CurrentY(PROP As Proporional_CurrentY)

Remarks
This is important method when we want that some CurrentY of printing will always be proportionally to the CurrentY of page number even when we use Zoom.

The setting parameters of PROP are as follows:
Constant | Value | Description
P0_Ignore | 0 | Ignore or cancel proportional. After every printing the control sets PROP to 0.
P1_Proporional_To_ currentYofPageNumber | 1 | The net printing will be considered by the control as proportional to the CurrentY of page number also when we use Zoom. After every printing the control sets PROP to 0, so you need to write this method always before you want proportional printing.


 fxreduceTwips Method
This method let you set a Single value, which used to compute the currentY (in Twips) of the line of page number printed. See also checkMin1 method

Syntax
form.ErezPP.fxreduceTwips(SZ As Single)

Remarks
The Single value SZ (in Twips) replace the default value (1000) of the control.


 fxToolTipCloseButton Method
Set the ToolTipText of the Close Button.

Syntax
form.ErezPP.fxToolTipCloseButton{ TXT As String }

Remarks
fxToolTipCloseButton Method is active only for registered users to let them change the ToolTipText of the Close Button.

Data Type
String

Default Value
1. for registered user is "Close Print Preview" and may be changed by developer.
2. for unregistered user is "Don't forget to register Erez Print Preview Control" but cannot be changed.


 gtBottomMargin Function
Get value, (in Twips), of the Bottom Margin of the control.

Syntax
X#=form.ErezPP.gtBottomMargin


 gtCharset Function
Get long value of the Charset used by the control at any moment.

Syntax
X&=form.ErezPP.gtCharset


 gtEndCurX Function
Get Single value (in Twips) of the present CurrentX point on the control.

Syntax
X!=form.ErezPP.gtEndCurX

Remarks
This Function used to get the present CurrentX point on the control. This works with gtStartCurX , which is the starting CurrentX point on the control. For example if you printed text then the start point of the text saved in the variable gtStartCurX and the end point of the text saved in the variable gtEndCurX. If you know those 2 variables then you can draw line or string of any character upon the text or under the text, for example using the fxPrintingChars method.


 gtLeftMargin Function
Get value, (in Twips), of the Left Margin of the control.

Syntax
X#=form.ErezPP.gtLeftMargin


 gtNumberOfFirstPage Function
Get integer value of the number of the first page. The number of the first page may be other then 1.

Syntax
X%=form.ErezPP.gtNumberOfFirstPage


 gtPageNumber Function
Get integer value of the existing page number at any moment.

Syntax
X%=form.ErezPP.gtPageNumber


 gtRightMargin Function
Get value, (in Twips), of the Right Margin of the control.

Syntax
X#=form.ErezPP.gtRightMargin


 gtStartCurX Function
Get Single value of the recent CurrentX point on the control (in Twips).

Syntax
X!=form.ErezPP.gtStartCurX

Remarks
This Function used to get the recent CurrentX point on the control. This works with gtEndCurX , which is the present CurrentX point on the control. For example if you printed text then the start point of the text saved in the variable gtStartCurX and the end point of the text saved in the variable gtEndCurX. If you know those 2 variables then you can draw line or string of any character upon the text or under the text, for example using the fxPrintingChars method.


 gtTopMargin Function
Get value (in Twips), of the Top Margin of the control.

Syntax
X#=form.ErezPP.gtTopMargin


 gtVersion Function
Get Single value of the Version of the control. this is important especially for future maintenance.

Syntax
X#=form.ErezPP.gtVersion


 JumpToNextLine Method
Move the cursor to the next line.

Syntax
form.ErezPP.JumpToNextLine

Remarks
"NextLine" is considered by the scaleHeight of the control.


 LeftIT Method
Align text to the left margin of the control.

Syntax
form.ErezPP.LeftIT(TXT As String, ByVal Entr As AfterPrintType)

Remarks
This method used to print text on the control and align it to the left margin of the control.

TXT is the text you want to be printed on the control. The font or color of the text as defined before using LeftIT.
Entr As AfterPrintType - you can see at the topic AfterPrintType


 PrintHeader Method
Print header which was defined earlier.

Syntax
form.ErezPP.PrintHeader

Remarks
PrintHeader is the command to print header by the control on every page. The control distinguishes between 2 kind of headers: "Header" and "AnyHeader" "Header" is printed on each starting page.
"AnyHeader" is printed anywhere of each page.
Hereinafter, the details of "Header" and "AnyHeader":
You can define up to 30 titles of "Header" and up to 20 titles of "AnyHeader". Each title has its property of Fontname, Fontsize, Fontbold etc. which defined by method.
Here are the methods for defining the properties of "Header" in details:
Syntax | Description
form.ErezPP. fxNameHeader(x%, TXT$) | Defines the title of each one of the 30 titles. x - integer value which points to the title number. TXT - is string value that represents the title name.
form.ErezPP. fxCurXHeader(x%, HeaderCurX!) | The horizontal starting point of the title. x - integer value which points to the title number from the 30 titles. HeaderCurX - Single value (in Twips) of the horizontal starting point of the title.
form.ErezPP. fxKindOfHeader (x%, AL As KindOfHeaderType) | Defines the kind of title. x - integer value which points to the title number from the 30 titles. AL As KindOfHeaderType - as follows: K0_KindOfText - value=0 K1_KindOfPicture - value=1
form.ErezPP. fxFontNameHeader (x%, TXT$) | The fontname of the title. x - integer value which points to the title number from the 30 titles. TXT - is string value that is the fontname of the title.
form.ErezPP. fxFontBoldHeader (x%, kd As Boolean} | Define if the font of the title is Bold. x - integer value which points to the title number from the 30 titles. kd - is Boolean value {True/False}.
form.ErezPP. fxFontItalicHeader (x%, kd As Boolean) | Define if the font of the title is Italic. x - integer value which points to the title number from the 30 titles. kd - is Boolean value {True/False}.
form.ErezPP. fxFontUnderlineHeader (x%, kd As Boolean) | Define if the font of the title is Underlined. x - integer value which points to the title number from the 30 titles. kd - is Boolean value {True/False}.
form.ErezPP. fxFontsizeHeader(x%, kd!) | Define the Fontsize of the title (Single value). x - integer value which points to the title number from the 30 titles. kd - is Single value.
form.ErezPP. fxForecolorHeader (x%, kd&) | Define the Forecolor of the title (Colorconstants value). x - integer value which points to the title number from the 30 titles. kd - is Long integer value.
form.ErezPP. fxAlignHeader (x%, AL As AlignType) | Define the alignment of the title. x - integer value which points to the title number from the 30 titles. for AL As AlignType see the topic AlignType
form.ErezPP. fxEnterAfterHeader(x%, kd%} | Define number of lines to jump after printing the title. x - integer value which points to the title number from the 30 titles. kd - is integer value represents the number of lines to jump after printing the title. zero value means that the cursor stays where it is
form.ErezPP. fxLinesBeforeHeader (x%, kd%) | Define number of lines to jump before printing the title. x - integer value which points to the title number from the 30 titles. kd - is integer value represents the number of lines to jump before printing the title. zero value means that the cursor stays where it is

PrintAnyHeader

PrintHeader as described above used also to print header of kind "AnyHeader" by the control on each page. You can define up to 20 titles. Each title has its property of Fontname, Fontsize, Fontbold etc. which defined by method
The difference between "Header" and "AnyHeader"
"Header" is printed at the beginning of every page and has no definitions of rows (CurrentY) just definitions of columns (CurrentX), and passing the cursor to next lines is done by the method "fxEnterAfterHeader". "AnyHeader" has its definitions of columns (CurrentX) for each title.
The methods of PrintAnyHeader are the same as PrintHeader as detailed above but with the addition word "Any". So we have the following methods of AnyHeader:
form.ErezPP.fxNameAnyHeader(x%, TXT$)
form.ErezPP.fxCurXAnyHeader(x%, kd%)
form.ErezPP.fxCurYAnyHeader(x%, kd%)
form.ErezPP.fxFontBoldAnyHeader(x%, kd As Boolean)
form.ErezPP.fxFontItalicAnyHeader(x%, kd As Boolean)
form.ErezPP.fxFontsizeAnyHeader(x%, kd!)
form.ErezPP.fxFontUnderlineAnyHeader(x%, kd As Boolean)
form.ErezPP.fxForecolorAnyHeader(x%, kd&)
form.ErezPP.fxKindOfAnyHeader(x%, AL As KindOfHeaderType)
form.ErezPP.fxAlignAnyHeader(x%, AL As AlignType)


 PrintingLineAbovePagenumber Method
Sets the character to draw above the page number of each page.

Syntax
form.ErezPP.PrintingLineAbovePagenumber(CharforPrintingTheLine As String)

Remarks
This method used to draw a line which consists of a character defined by you. The line is drawn above the number of page on each page. Probably you want a line which consists from = or * or - etc.


 printLastPage Method
This Method used to finish the printing arrangement and to starting the Preview.

Syntax
form.ErezPP.printLastPage


 printPage Method
Print the number of the page and continue with new page.

Syntax
form.ErezPP.printPage

Remarks
This method used to stop forming the present page, print the number of the page and continue with new page.


 printText Method
Print text on the control.

Syntax
form.ErezPP.printText(TXT As String, Entr As AfterPrintType)

Remarks
TXT is the text you want to be printed in the control. The font or color of the text as defined before using printText.
Entr As AfterPrintType - you can see at the topic AfterPrintType


 ReadPrint Method
This method reads formed pages from a binary file which was saved by SavePrint method. It reads text as well as graphic.

Syntax
form.ErezPP.ReadPrint (FileName As String)

Remarks
This is a good feature that allows you to join another formed pages together with the present printing.
If the control can't open the defined file for some reasons, like mistake of the path etc. then you'll get error message from the control.
The parameters for the ReadPrint method are described below

FileName As String:
The name of the saved file to be read.
The name of the file may include path.

Example
Suppose you want to read the report to a file name "graphics.saved" in a folder "\graphics\graphics1\graphics2" under App.path then you should do this:
E.ReadPrint App.Path & "\graphics\graphics1\graphics2\graphics.saved"
If you do ReadPrint Method from your Integrated Development Environment (IDE) then the App.Path is the folder where your VBP file exists.
If you do ReadPrint Method from the compiled file (EXE file) then the App.Path is the folder where the compiled file exists.


 RightIT Method
Align text to the right margin of the control.

Syntax
form.ErezPP.RightIT(TXT As String, Entr As AfterPrintType)

Remarks
This method used to print text on the control and align it to the right margin of the control.

TXT is the text you want to be printed on the control. The font or color of the text as defined before using RightIT.
Entr As AfterPrintType - you can see at the topic AfterPrintType


 SavePagesAsBitmaps Method
This method let you save few or all printing pages to BMP files.

Syntax
form.ErezPP.SavePagesAsBitmaps (FileName As String, saveAllPages As Boolean, Optional fromPage As Integer, Optional toPage As Integer)

Remarks
The parameters for the SavePagesAsBitmaps method are described below:

FileName As String:
The name of the BMP file for each page. Write the net name without any path. The control will save each page with the above filename together with the page number at the App.Path folder.

saveAllPages As Boolean:
Set this parameter to true if you want the control to save all the printing pages. If you want to save only few page then you may use the next optional parameters: "fromPage" and "toPage"

Example
Suppose you want to save only page 2 and 3 to files name "BHS" then you should write this:
form.ErezPP.SavePagesAsBitmaps "BHS", False, 2, 3
You'll see at the App.Path folder 2 files: "BHS2.bmp" and "BHS3.bmp"
If you want to save all pages then you may ignore the optional parameters and write this:
form.ErezPP.SavePagesAsBitmaps "BHS", True


 SavePrint Method
This method saves the formed pages in a binary file structure for future using. The method saves text as well as graphic. You can reload the file by using the ReadPrint method.

Syntax
form.ErezPP.SavePrint (FileName As String, Cancel As Boolean)

Remarks
The parameters for the SavePrint method are described below:

FileName As String:
The name of the file may include path. If a file with the same name already exists, it is overwritten. The control creates new folder if it is included in the filename but does not exist.

Cancel As Boolean:
This parameter is true in any case the control cannot write to the file name noted. For example, when the file name exists and its attribute is "read only". So please read this parameter after you tried to execute the Method and if you get Cancel=True then you know that the control didn't succeed to execute the Method and you have to fix it.

Example
Suppose you want to save the report to a file name "graphics.saved" in a folder "\graphics\graphics1\graphics2" under App.path then you should do this:
1. DIM Cancel as Boolean
2. E.SavePrint App.Path & "\graphics\graphics1\graphics2\graphics.saved", Cancel
If you get Cancel=True from the control then you know the SavePrint Method did not succeed and you have to send the right message to your end user.
Be aware that the control creates automatically new folder whenever needed.
If you do SavePrint Method from your Integrated Development Environment (IDE) then the App.Path is the folder where your VBP file exists.
If you do SavePrint Method from the compiled file (EXE file) then the App.Path is the folder where the compiled file exists.


 SpecialCenter Method
Centering text between 2 points on the control.

Syntax
form.ErezPP.SpecialCenter(startxPoint As Single, endxPoint As Single, TXT As String, Entr As AfterPrintType, startyPoint As Single, Optional endyPoint As Single)

Remarks
SpecialCenter let you Centering text between 2 points on the control. This differs from the method centerIT because it centers text between any 2 defined points but centerIT centers the text between rightmargin and left margin of the control.
If you want the text to be centered also between 2 CurrentY points then you should define the last 2 parameters: startyPoint and endyPoint.

The setting parameters of SpecialCenter are as follows:
Constant | Description
startxPoint, endxPoint | Single values indicating (in Twips) the startpoint and endpoint for the text to be centered between them.
TXT As String | A String value indicates the text to be printed on the control.
Entr As AfterPrintType | see the topic AfterPrintType
startyPoint | Single value indicates (in Twips) the start CurrentY point for the text to be printed.
endyPoint | Optional parameter. Single value indicates (in Twips) the end CurrentY point for the text to be printed. If you define this parameter then the text will be centered between startyPoint and endyPoint considering the Height of the text. This is important when using grid to center text inside some cell.


 SpreadText Methods
Those methods let you force lines of text to be spreaded to a defined right point if you use the LTR control, or to a defined left point if you use the RTL control, so you can have a block of text which is right aligned and left aligned.

Syntax
For the LTR control:
form.ErezPP.SpreadTextToRight(txtDemo As String, TXT As String, Entr As AfterPrintType)

For the RTL control:
form.ErezPP.SpreadTextToLeft(txtDemo As String, TXT As String, Entr As AfterPrintType)

Remarks
The parameters for the SpreadText methods are described below:

txtDemo As String:
txtDemo is the text which the control compute its width as the maximum width for finding the last point for spreading the text line. The txtDemo can be one of the lines which has the biggest width.
When computing the spreading, the control considers the resolution of the preview or the printer.

TXT As String:
TXT is the requested text to be printed in the line.

Entr As AfterPrintType - you can see at the topic AfterPrintType


 StartErezPrintPreview Method
Initialize the control.

Syntax
form.ErezPP.StartErezPrintPreview (App.Path)

Remarks
This method initialize the control, sets the default properties of the control which it contains, the Header (if defined) etc.
you should write this method before you are allowed to print anything on the control.
Always use the following code lines before printing anything on the control:
Assume that the name of the Form, which is the container of the control, is frmPP and it contains the LTR control.
First you should define Object E (or any other letter) for the control as: "Public E As ErezPP1LTR"
If you want the control to be Public then you have to write it at the general section of a Module. If you don't need Public then you can write "Dim E As ErezPP1LTR" at the general section of a Form.
The code lines should be as follows:
Set E = frmPP.ErezPP1LTR
frmPP.Show
E.StartErezPrintPreview App.Path
App.Path is sent to the control which needs it for saving or reading printing report.
Please refer to our samples of VB6.


 stCharset Method
This method let you set the Charset for the control so you can switch between languages whenever you need it.

Syntax
form.ErezPP.stCharset(Chrset As KnownCharsetType)

Remarks
The parameters for the stCharset method are described below:

Chrset As KnownCharsetType:
KnownCharsetType is a Public Enum used by microsoft and their valuesare as follows:
ANSI_CHARSET = 0
DEFAULT_CHARSET = 1
SYMBOL_CHARSET = 2
SHIFTJIS_CHARSET = 128
HANGEUL_CHARSET = 129
GB2312_CHARSET = 134
CHINESEBIG5_CHARSET = 136
OEM_CHARSET = 255
JOHAB_CHARSET = 130
HEBREW_CHARSET = 177
ARABIC_CHARSET = 178
GREEK_CHARSET = 161
TURKISH_CHARSET = 162
VIETNAMESE_CHARSET = 163
THAI_CHARSET = 222
EASTEUROPE_CHARSET = 238
RUSSIAN_CHARSET = 204
MAC_CHARSET = 77
BALTIC_CHARSET = 186

it is important to note that 0 is Western, and 1 is Default.
Example
Suppose you want to write some words with English and then switch to Arabic and write few words then you should do this:
form.ErezPP.stCharset ANSI_CHARSET ' western
form.ErezPP.FontName = "Times New Roman"
form.ErezPP.FontSize = 12
form.ErezPP.ForeColor = vbRed
form.ErezPP.printText "Hello world", 2

Now switch to Arabic and print some letters:
form.ErezPP.stCharset ARABIC_CHARSET
form.ErezPP.FontName = "arial"
form.ErezPP.FontSize = 12
form.ErezPP.ForeColor = 32768
form.ErezPP.printText Chr(224) & Chr(225) & Chr(226) & Chr(227) & Chr(228) & Chr(229), 2

Now restore the local charset:
form.ErezPP.stCharset DEFAULT_CHARSET


 tfCenterPages Method
Center all the pages.

Syntax
form.ErezPP.tfCenterPages { True/False }

Remarks
set tfCenterPages to True causes the control to center all the pages during forming the pages. The control has its method of measuring the centering. Just set tfCenterPages to True and live the control to make the job for you.

Data Type
Boolean

Default Value
False


 writeMsgbox Method
Messages used by the control and may be changed by you.

Syntax
form.ErezPP.writeMsgbox(Message As txtMessageType, TXT As String)

Remarks
For now you can change 4 messages as follows:

Message - 0
K0_Please_write_number_of_copies_1_or_higher
Message when the user defines 0 copies to the printer
Message - 1
K1_Is_the_number_of_copies_OK
Message when the user defines more then 99 copies to the printer to get confirmation from him
Message - 2
K2_Not_found_any_more
Message when the control didn't find any more string which it requested to find.
Message - 3
K3_Printer_problem_Please_check_if_a_printer_is_connected_etc
Message for printer problem


 printLine Method
Draws line on the control.

Syntax
form.ErezPP.printLine(lStartCurX!, lStartCurY!, lEndCurX!, lEndCurY!, lColor&, lDrawMode As DrawModeConstants, lDrawStyle As DrawStyleConstants, lDrawWidth%, AL As AlignType)

Remarks
printBox let you drawing box on the control. You may put a text inside the box using the last parameter txtInsideBox As String.

The setting parameters of printBox are as follows:
Constant | Description
StartCurX, lStartCurY | Single values indicating the coordinates of the starting point for the line (in Twips).
EndCurX, lEndCurY | Single values indicating the coordinates of the end point for the line being drawn.
lColor | Long value indicating the color used to draw the line.
lDrawMode | A value that determines the appearance of the line. see in details DrawMode
lDrawStyle | A value that determines the line style for output. see in details DrawStyle
lDrawWidth | Integer value indicating the line width for output. see in details DrawWidth
AL As AlignType | see the topic AlignType


 printBox Method
Draws rectangle on the control.

Syntax
form.ErezPP.printBox(bStartCurX!, bStartCurY!, bEndCurX!, bEndCurY!, bFillColor&, bDrawStyle As DrawStyleConstants, bDrawMode As DrawModeConstants, bDrawWidth%, bFillStyle As FillStyleConstants, AL As AlignType, txtInsideBox As String)

Remarks
printBox let you drawing box on the control. You may put a text inside the box using the last parameter txtInsideBox As String.

The setting parameters of printBox are as follows:

Constant | Description
bStartCurX, bStartCurY | Single values indicating the coordinates of the starting point for the box (in Twips).
bEndCurX, bEndCurY | Single values indicating the coordinates of the end point for the box being drawn.
bFillColor | Long value indicating the color used to fill in the box. see in details FillColor
bDrawStyle | A value that determines the line style for output from graphic methods. see in details DrawStyle
bDrawMode | A value that determines the appearance of output from graphic methods. see in details DrawMode
bDrawWidth | Integer value indicating the line width for output from graphic methods. see in details DrawWidth
bFillStyle | Sets the pattern used to fill Shape controls as well as circles and boxes created with the Circle and Line graphic methods. see in details FillStyle
AL As AlignType | See the topic AlignType
txtInsideBox As String | String of 60 character maximum, indicates the text to be written inside the box. The text is centered inside the box. If you don't want a text inside the box just put "" for this parameter.


 printCircle Method
Draws circle, ellipse, or arc on the control.

Syntax
form.ErezPP.printCircle(CenterPointOfCurX!, CenterPointOfCury!, cFillColor&, cDrawStyle As DrawStyleConstants, cDrawMode As DrawModeConstants, cDrawWidth%, cFillStyle As FillStyleConstants, CRadius!, AL As AlignType, [cColor&], [StartRadians!], [EndRadians!], [txtInsideCircle As String], [AspectRatio!])

Remarks
printCircle let you drawing circle, ellipse, or arc on the control. You may put a text inside the circle using the last parameter txtInsideCircle As String.

The setting parameters of printCircle are as follows:
Constant | Description
CenterPointOfCurX, CenterPointOfCury | Single values (in Twips) indicating the coordinates for the center point of the circle, ellipse, or arc.
bEndCurX, bEndCurY | Single values indicating the coordinates of the end point for the box being drawn.
cFillColor | Long value indicating the color used to fill in the circle or ellipse. Only a closed figure can be filled. Closed figures include circles, ellipses, or pie slices (arcs with radius lines drawn at both ends). see in details FillColor
cDrawStyle | A value that determines the way the circle is drawn on the background. see in details DrawStyle
cDrawMode | A value that determines the way the circle is drawn on the control. see in details DrawMode
cDrawWidth | Integer value indicating the line width used to draw the circle, ellipse, or arc on the control. see in details DrawWidth
cFillStyle | A value that determines the pattern used to fill circle, ellipse, or arc on the control. see in details FillStyle
CRadius | A Single value indicating the radius of the circle, ellipse, or arc on the control. see in details FillStyle
AL As AlignType | see the topic AlignType
cColor (Optional) | A Long integer value indicating the color of the circle's, ellipse's, or arc's outline on the control.
StartRadians, EndRadians (Optional) | Single-precision values. When an arc or a partial circle or ellipse is drawn, StartRadians and EndRadians specify (in radians) the beginning and end positions of the arc. The range for both is –2 pi radians to 2 pi radians. The default value for start is 0 radians; the default for end is 2 * pi radians.
txtInsideCircle As String | String of 60 character maximum, indicates the text to be written inside the circle, ellipse, or arc. The text is centered inside it. If you don't want a text inside just put "" for this parameter.
AspectRatio (Optional) | A Single-precision value indicating the aspect ratio of the circle. The default value is 1.0, which yields a perfect (non-elliptical) circle on any screen.


 printPicture Method
Draws picture on the control.

Syntax
form.ErezPP.printPicture(txtFileBitmap As String, ALH As AlignPicHorizontalType, ALV As AlignPicVerticalType)

Remarks
printPicture let you draw the contents of a graphic file (.bmp, .wmf, .emf, .cur, .ico, or .dib) on the control.

The setting parameters of printPicture are as follows:
Constant | Description
txtFileBitmap | The name of the Bitmap file, Can include folder and drive. Graphic format recognized by Visual Basic, includes bitmap (.bmp) files, icon (.ico) files, cursor (.cur) files, run-length encoded (.rle) files, metafile (.wmf) files, enhanced metafiles (.emf), GIF (.gif) files, and JPEG (.jpg) files.
ALH As AlignPicHorizontalType | Sets the horizontal alignment of the picture on the control. The setting parameter of alignment are as follows:
 | Constant |  | Value |  | Description
 | A0_AlignPicHorizontalNone |  | 0 |  | Ignore alignment and use the present cursor as the starting point for the picture.
 | A1_AlignPicHorizontalRight |  | 1 |  | Align the picture to the right edge of the control.
 | A2_AlignPicHorizontalCenter |  | 2 |  | Center the picture on the control. This is horizontal centering and considers the right and left margin of the control.
 | A3_AlignPicHorizontalLeft |  | 3 |  | Align the picture to the left edge of the control.
ALV As AlignPicVerticalType | Sets the vertical alignment of the picture on the control. The setting parameter of alignment are as follows:
 | Constant | Value |  | Description
 | A0_AlignPicVerticalNone | 0 |  | Ignore alignment and use the present cursor as the starting point for the picture.
 | A1_AlignPicVerticalTop | 1 |  | Align the picture to the top edge of the control.
 | A2_AlignPicVerticalCenter | 2 |  | Center the picture on the control. This is vertical centering and considers the top and bottom margins of the control.
 | A3_AlignPicVerticalBottom | 3 |  | Align the picture to the bottom edge of the control.

Example
Suppose you want to draw a Picture from a file name "erezsh14.gif" which exists under App.path and you want it to be centered Horizontally then you should do this:
E.printPicture App.Path & "\erezsh14.gif", A2_AlignPicHorizontalCenter, A0_AlignPicVerticalNone
The picture will be drawn from the existing CurrentY point on the control.


 DrawStyle
Returns or sets a value that determines the line style for output from graphic methods.
The graphic methods are Circle, Line, PaintPicture, Point, Print, and PSet.
Using circle method draws ellipse and arc.
Using line method draws rectangle.

Remarks
The settings for number as detailed in Visual Basic Documentation are:


 DrawWidth
Returns or sets the line width for output from graphic methods.
The graphic methods are Circle, Line, PaintPicture, Point, Print, and PSet.
Using circle method draws ellipse and arc.
Using line method draws rectangle.

Remarks
integer value indicating the line width for output from graphic methods. A numeric expression from 1 through 32,767. This value represents the width of the line in pixels. The default is 1; that is, 1 pixel wide. Increase the value of this property to increase the width of the line. If the DrawWidth property setting is greater than 1, DrawStyle property settings 1 through 4 produce a solid line (the DrawStyle property value isn't changed). Setting DrawWidth to 1 allows DrawStyle to produce the results shown in the DrawStyle property table.


 FillColor
Returns or sets the color (Long value) used to fill in circles and boxes created with the Circle and Line graphic methods.

Remarks
By default, FillColor is set to 0 (Black).
When the FillStyle property is set to its default, 1 (Transparent), the FillColor setting is ignored.


 FillStyle
Returns or sets a value that determines the line style for output from graphic methods.
The graphic methods are Circle, Line, PaintPicture, Point, Print, and PSet.
Using circle method draws ellipse and arc.
Using line method draws rectangle.

Remarks
Sets the pattern used to fill Shape controls as well as circles and boxes created with the Circle and Line graphic methods. The settings for number as detailed in Visual Basic Documentation are:


 DrawMode
Returns or sets a value that determines the appearance of output from graphic methods or the appearance of a Shape or Line controls.
The graphic methods are Circle, Line, PaintPicture, Point, Print, and PSet.
Using circle method draws ellipse and arc.
Using line method draws rectangle.

Remarks
The settings for number as detailed in Visual Basic Documentation are:


 End User Options
ErezPP control gives your customers the ability to fit some features of the control to their needs. They can do it by clicking the ComboBox which exists at the top right of the control. clicking that ComboBox will open some options for the end user as we can see here.

All the definitions as Margins Setup, Zoom Options and Backcolor are saved by the control at the folder which is accepted by "Curdrive", therefore if you have multiuser using your application at the same time in a network, it's a good idea that each one of them works at different folder, so changing one of the above definitions will affect only that user and not all the others, and thus everyone can set his favourites.

Let us review the options:

Margins Setup
Set the values (Centimetres) of TopMargin, BottomMargin, LeftMargin and RightMargin as shown here:

The end user can't write the value but chooses it using ComboBox. At the bottom of the frame he may click CheckBox if he wants to get the default values as follows:
LeftMargin = 1.5 cm
RightMargin = 1.5 cm
TopMargin = 1.5 cm
BottomMargin = 3.5 cm

Zoom Options
Set the way of considering CurrentX, Width and Height of the control when changing the Zoom. If the end user sets the CheckBox to True then it will be changed proportional to the increase or decrease of the Zoom (the CurrentX, Width or Height according to value of their CheckBox).

Center this page
Center the page seen on the screen.

Center all pages
Center all the pages.
When printing the pages to the printer, the end user can determine if the pages will be printed considering the Zoom or ignoring the Zoom.
You, the developer, can use method in advance to cause the control to center all the pages. Please see the method tfCenterPages

Change Backcolors
Change the Backcolor of buttons, frames, combo box and the preview by the end user.
If your application is multiusers working on network then each station can have its favourite Backcolors. In order to have this you must take care of different folder for each station in the network.

Zoom In - Zoom Out
The end user can Zoom In or Zoom Out the formed pages as you can see here:

Ther is a ComboBox that let the end user changing the Zoom by selecting one item from the ComboBox. The Zoom items have interval of 10%, starting from 20% and ending with 200%.
The end user can also click the Zoomin icon [image] or Zoomout icon [image] at the right side of the control in order to Zoom In or Zoom Out with interval of 10%.

Search and Continue Search
The end user can search text at the preview pages as you can see here:

Search
The end user can click at the search button with the mouse or press F3 in order to find a string. Then he gets a text box to write the string to find as follows:
If the control finds the string it paints it with Magenta color. If the string not found then the control will arise message "not found" with the name of the string.

Continue Search
To continue searching the same text that he has just found, the end user has to click at the Continue Search button or press F3 again. Then the control continue searching the same string.

Browsing the preview pages
The end user can browse the preview pages as you can see the button above.
The browsing can be done with the mouse or by pressing a key at the keyboard as follows:
Button First F5 - preview the first page.
Button Previous F6 - preview the Previous page.
Button Next F7 - preview the next page.
Button Last F8 - preview the last page.

Printing the preview pages
The end user can print the whole preview pages or part of them by clicking the printer button.
As you can see here the end user can choose the printer, number of copies and more:


 Mixed Languages
ErezPP control let you print on the same line, titles, each one of different langauge as shown in this example of mixing English/Hebrew

You can print titles one after one or to get all of them centered by the control as follows:

Printing formed titles one after one
Form the first title, use the method printText to print it without jumping to the next line, do the same process to the second title and so on, besides that for the last title in the line you have to use the method printText with jumping to the next line.

Centering complex title consists of some languages
In order to do that, ErezPP control has method centerMixedLanguages that join together all the formed texts of the same line and compute the starting CurrentX for centering.


 Create and Print Grid
You can create and print grid like this in the control easily.
This is done by using the printLine method. You can get experience by the samples given with the control.

There are 2 ways of using grid:
1. You can draw the vertical and horizontal lines in advance and afterwards to fill each cell with text. You can compute the place of each cell in order to fill it with text.
2. You can do it step by step. Draw the first vertical and horizontal line and fill each cell with text. This system let you draw on every row different number of columns.


 Graphic Samples
Here are some graphic samples:
All the graphic samples are centered by the control.
Inside the rectangle and the ellipse there is printed text which is centered inside them.
There is a thick blue line, which is printed under a text, and its width was computed by the control according to the width of the text above it.
Please see the code lines in the examples that created the graphic.


 Search Text
ErezPP control let the end user search text at the preview.
The end user writes the text to search and the control paints the founded text with Magenta colour, and of course scrolls to the page that includes the founded text.

If the end user use the Left To Right control then he can write the text from left to right as needed to be found.

If the end user use the Right To Left control then he should be aware to the following:
If he wants to find text from right to left then he can write it from right to left as needed to be found.
If he wants to find number or text of Left To Right language as English then at the Text Box he has to press Alt + Left Shift to change the direction of the cursor to Left To Right and afterwards writes his text or number to search. number is to be written at the Text Box with the commas.


CurrentYofPageNumber

 CurrentYofPageNumber Property
Returns the CurrentY of the page number.

Syntax
X!=form.ErezPP.CurrentYofPageNumber

Remarks
usually, the place (in Twips) counted by the control equal to Printer.Height - BottomMargin

Data Type
Single

Default Value
0