'=================================================
'IMPORTANT: AS THIS IS A DEMO, DIAGONAL LINES WILL
'APPEAR ON CERTAIN PAGES. SO PLEASE MAKE YOUR TESTS
'ON PLAIN PAPER TO SAVE YOUR LABELS.
'=================================================


'INFO: for the code labels not listed in SCMLlblPDem5.dll,
'you can get the labels dimensions in Microsoft Word in the
'"Details" section of the label dialog box.


Dim i As Integer
Dim X As Integer
Dim LABELdemoObj As SCMLlblPdemo5
'-----------------------------------
Dim infogen() As info

'"info" is a built-in user-defined type (UDT) that has
'up to 15 members named info1, info2,..., info15.

'-----------------------------------
Dim dbs As Database
Dim rsLBL As DAO.Recordset
Private Sub Command1_Click()
Screen.MousePointer = 11
'Populates the UDT

X = 26
ReDim infogen(X)
For i = 0 To X
infogen(i).info1 = "Last name" & i
infogen(i).info2 = "First name" & i
infogen(i).info3 = "Address" & i
infogen(i).info4 = "City" & i
infogen(i).info5 = "postal code" & i
infogen(i).info6 = "info6" & i
Next i

LABELdemoObj.withImage = True
LABELdemoObj.imagePath = App.Path & "\testimage.gif"

LABELdemoObj.PreviewWindowSizable = True

LABELdemoObj.LabelFont = "arial"
LABELdemoObj.FontStyle = fITALIC
LABELdemoObj.FontSize = 11
LABELdemoObj.LabelCode = c5162
LABELdemoObj.Grid = True
LABELdemoObj.PrintLabel infogen()

Screen.MousePointer = 0
End Sub

Private Sub Command2_Click()
Screen.MousePointer = 11

LABELdemoObj.PreviewWindowSizable = False

LABELdemoObj.withImage = False
LABELdemoObj.FontStyle = fNORMAL
LABELdemoObj.LabelFont = "tahoma"
LABELdemoObj.LabelCode = c5162
LABELdemoObj.Grid = True
LABELdemoObj.PrintLabelRS rsLBL

Screen.MousePointer = 0
End Sub

Private Sub Command3_Click()
Screen.MousePointer = 11

X = 26
ReDim infogen(X)
For i = 0 To X
infogen(i).info1 = "1111111111222222222233333333334444444444555555555566666666667777777777"
infogen(i).info2 = "99999999998888888888777777777766666666665555555555444444444433333333332222222222"
infogen(i).info3 = "Address" & i
infogen(i).info4 = "City" & i
infogen(i).info5 = "postal code" & i
infogen(i).info6 = "text on line6"
Next i

LABELdemoObj.adjustHeight = 0.2
LABELdemoObj.adjustLeft = 0.5
LABELdemoObj.Grid = True
LABELdemoObj.FontSize = 8
LABELdemoObj.LabelFont = "times new roman"
'LABELdemoObj.LabelFont = "tahoma"

LABELdemoObj.FontStyle = fUNDERLINED

LABELdemoObj.PrintLabelX 0.83, 0.16, 1.33, 4.19, 1.33, 4, 2, 7, infogen()

Screen.MousePointer = 0
End Sub

Private Sub Command4_Click()
Screen.MousePointer = 11

'to reset adjustements changed in Command3
LABELdemoObj.adjustHeight = 0
LABELdemoObj.adjustLeft = 0
LABELdemoObj.FontStyle = fITALIC Or fBOLD
LABELdemoObj.LabelFont = "times new roman"
'LABELdemoObj.LabelFont = "tahoma"

LABELdemoObj.Grid = True
LABELdemoObj.PrintLabelXRS 0.83, 0.16, 1.33, 4.19, 1.33, 4, 2, 7, rsLBL

Screen.MousePointer = 0
End Sub



Private Sub Command5_Click()
Screen.MousePointer = 11

LABELdemoObj.FontStyle = fBOLD
LABELdemoObj.Grid = True
LABELdemoObj.LabelFont = "times new roman"
'LABELdemoObj.LabelFont = "tahoma"

LABELdemoObj.PrintONElabelX 5, 0.5, 1.34, 0.67, 5.81, 0.67, 5.81, 1, 15, "Hello"

Screen.MousePointer = 0
End Sub

Private Sub Command6_Click()
Dim LABELdemoObj2 As New SCMLlblPdemo5

Screen.MousePointer = 11

'NOTE: scroll the page or zoom out to see the text
'near the end of the page

LABELdemoObj2.LabelFont = "courier new"

LABELdemoObj2.FontSize = 10
LABELdemoObj2.FontStyle = fUNDERLINED Or fBOLD
LABELdemoObj2.LabelCode = c5167
LABELdemoObj2.Grid = True
LABELdemoObj2.PrintONElabel 79, "Hello1", "Hello2"

Screen.MousePointer = 0

Set LABELdemoObj2 = Nothing
End Sub

Private Sub Command7_Click()
MsgBox "Please refer to the code for this command button."

'First put a Data control on the form,
'fill the Data1 control properties
'and uncomment the following

'LABELdemoObj.LabelCode = c5162
'LABELdemoObj.Grid = True
'LABELdemoObj.PrintLabelRS Data1.Recordset
End Sub


Private Sub Form_Load()
Dim DBpath As String

Set LABELdemoObj = New SCMLlblPdemo5

DBpath = App.Path & "\SCMLtestDB.mdb"

Set dbs = OpenDatabase(DBpath)

SQL$ = "select DBCUSTNAME, DBADDRESS, DBCITY, DBZIP "
SQL$ = SQL$ & "FROM AddressTable"

Set rsLBL = dbs.OpenRecordset(SQL$)

End Sub


Private Sub Form_Unload(Cancel As Integer)
rsLBL.Close
Set rsLBL = Nothing
dbs.Close
Set dbs = Nothing
Set LABELdemoObj = Nothing

End Sub

BACK