'set Bearer bars
TALBarCd1.BearerBars = chkBearer.Value
End Sub
Private Sub chkQuiet_Click()
'set quiet zones
TALBarCd1.QuietZones = chkQuiet.Value
End Sub
Private Sub cmdBrowse_Click()
'This routine displays a dialog box from which the user can select a folder
PathForm.Show 1
End Sub
Private Sub Combo1_Click()
'Set Symbology
TALBarCd1.Symbology = Combo1.ListIndex
End Sub
Private Sub Combo2_Click()
'Set rotation
TALBarCd1.Rotation = Combo2.ListIndex
End Sub
Private Sub Combo3_Click()
'set comment alignment
TALBarCd1.CommentAlignment = Combo3.ListIndex
End Sub
Private Sub Combo4_Click()
'set Fore color
Select Case Combo4.ListIndex
Case 0: C& = 0
Case 1: C& = &HFFFFFF
Case 2: C& = &HFF
Case 3: C& = &HFF00&
Case 4: C& = &HFF0000
End Select
TALBarCd1.ForeColor = C&
End Sub
Private Sub Combo5_Click()
'Set Back color
Select Case Combo5.ListIndex
Case 0: C& = 0
Case 1: C& = &HFFFFFF
Case 2: C& = &HFF
Case 3: C& = &HFF00&
Case 4: C& = &HFF0000
End Select
TALBarCd1.BackColor = C&
End Sub
Private Sub Dir1_Change()
'After changing the image path update the textbox on the form
txtImagePath.Text = Dir1.Path
End Sub
Private Sub Form_Load()
'When the form loads...
'fill Symbology dropdown with list of symbologies
Combo1.AddItem "Code 39"
Combo1.AddItem "Code 39 Full ASCII"
Combo1.AddItem "Code 39 HIBC"
Combo1.AddItem "Codabar"
Combo1.AddItem "Code 93"
Combo1.AddItem "Code 128"
Combo1.AddItem "EAN/UCC 128"
Combo1.AddItem "Interleaved 2 of 5"
Combo1.AddItem "Postnet"
Combo1.AddItem "UPC-A"
Combo1.AddItem "UPC-E"
Combo1.AddItem "EAN-8"
Combo1.AddItem "EAN-13"
Combo1.AddItem "Bookland"
Combo1.AddItem "MSI/Plessey"
Combo1.AddItem "PDF417"
Combo1.AddItem "Aztec Code"
Combo1.AddItem "Data Matrix"
Combo1.AddItem "Maxicode"
'Get the last symbology used from the registry.
Combo1.ListIndex = GetSetting("BCGen", "Settings", "Symbology", "0")
'fill Rotation dropdown
Combo2.AddItem "0 Degrees"
Combo2.AddItem "90 Degrees"
Combo2.AddItem "180 Degrees"
Combo2.AddItem "270 Degrees"
'Get the last Rotation setting from the registry.
Combo2.ListIndex = GetSetting("BCGen", "Settings", "Rotation", "0")
'fill Comment alignment dropdown
Combo3.AddItem "Left"
Combo3.AddItem "Center"
Combo3.AddItem "Right"
'Get the last Comment Alignment setting from the registry.
Combo3.ListIndex = GetSetting("BCGen", "Settings", "commentAlignment", "0")
'fill Fore Color dropdown
Combo4.AddItem "Black"
Combo4.AddItem "White"
Combo4.AddItem "Red"
Combo4.AddItem "Green"
Combo4.AddItem "Blue"
'Get the last Forecolor setting from the registry.
Combo4.ListIndex = GetSetting("BCGen", "Settings", "ForeColor", "0")
'fill Back Color dropdown
Combo5.AddItem "Black"
Combo5.AddItem "White"
Combo5.AddItem "Red"
Combo5.AddItem "Green"
Combo5.AddItem "Blue"
'Get the last Backcolor setting from the registry.
Combo5.ListIndex = GetSetting("BCGen", "Settings", "BackColor", "1")
'MainForm.TALBarCd1.BackColor = Combo5.ListIndex
'Get the last Image resolution used from the registry or use a default of 300
txtImageResolution = GetSetting("BCGen", "Settings", "RasterResolution", "300")
'set image resolution property
MainForm.TALBarCd1.RasterImageResolution = txtImageResolution.Text
'Get the last Narrow Bar Width setting from registry or use a default of 13
txtNarrowBW = GetSetting("BCGen", "Settings", "NarrowBarWidth", "13")
'set narrow bar width property
MainForm.TALBarCd1.NarrowBarWidth = txtNarrowBW.Text
'Get the last BarHeight setting from registry or use a default of 1000
txtBarHeight = GetSetting("BCGen", "Settings", "BarHeight", "1000")
MainForm.TALBarCd1.BarHeight = txtBarHeight.Text
'Get the last Bar Width Reduction setting from registry or use a default of 0
txtBarWidthRed = GetSetting("BCGen", "Settings", "BarWidthReduction", "0")
MainForm.TALBarCd1.BarWidthReduction = txtBarWidthRed.Text
'Get the last Matrix Module size setting from registry or use a default of 20
txtMatrixModSize = GetSetting("BCGen", "Settings", "MatrixModuleSize", "20")
MainForm.TALBarCd1.MatrixModuleSize = txtMatrixModSize.Text
'Get the last Quiet Zones setting from registry or use a default of 1 (meaning "On")
chkQuiet = GetSetting("BCGen", "Settings", "QuietZones", "1")
MainForm.TALBarCd1.QuietZones = chkQuiet.Value
'Get the last BearerBars setting from registry or use a default of 0 (meaning "Off")
chkBearer = GetSetting("BCGen", "Settings", "BearerBars", "0")
MainForm.TALBarCd1.BearerBars = chkBearer.Value
End Sub
Private Sub Form_Unload(Cancel As Integer)
'save new settings to the registry
SaveSetting "BCGen", "Settings", "Symbology", Combo1.ListIndex
SaveSetting "BCGen", "Settings", "Rotation", Combo2.ListIndex
SaveSetting "BCGen", "Settings", "CommentAlignment", Combo3.ListIndex
SaveSetting "BCGen", "Settings", "ForeColor", Combo4.ListIndex
SaveSetting "BCGen", "Settings", "BackColor", Combo5.ListIndex
SaveSetting "BCGen", "Settings", "imagepath", txtImagePath
SaveSetting "BCGen", "Settings", "RasterResolution", txtImageResolution
SaveSetting "BCGen", "Settings", "NarrowBarWidth", txtNarrowBW
SaveSetting "BCGen", "Settings", "BarHeight", txtBarHeight
SaveSetting "BCGen", "Settings", "BarWidthReduction", txtBarWidthRed
SaveSetting "BCGen", "Settings", "MatrixModuleSize", txtMatrixModSize
SaveSetting "BCGen", "Settings", "QuietZones", chkQuiet
SaveSetting "BCGen", "Settings", "BearerBars", chkBearer
End Sub
Private Sub mExit_Click()
'exit from menu
Unload Me
End Sub
Private Sub Text1_Change()
'When user types new text into Message text box, update barcode
TALBarCd1.Message = Text1.Text
End Sub
Private Sub Text2_Change()
'When user types new text into Comment text box, update barcode
TALBarCd1.Comment = Text2.Text
End Sub
Private Sub txtImagePath_Change()
'if the imagepath is typed in without a trailing backslash, then put one in
If Right(Me.txtImagePath, 1) <> "" Then
Me.txtImagePath = Me.txtImagePath + ""
End If
End Sub
Private Sub txtBarHeight_Change()
'if the bar height is changed to a value between 11 and 6999 then set the bar height, otherwise beep.
If Val(txtBarHeight.Text) > 10 And Val(txtBarHeight.Text) < 7000 Then
TALBarCd1.BarHeight = Val(txtBarHeight.Text)
Else
Beep
End If
End Sub
Private Sub txtBarWidthRed_Change()
'if the bar width reduction is changed to a value between 99 and -99 then set the bar width reduction, otherwise beep.
If (Val(txtBarWidthRed.Text) < 100) And (Val(txtBarWidthRed.Text) > -100) Then
TALBarCd1.BarWidthReduction = Val(txtBarWidthRed.Text)
Else
Beep
End If
End Sub
Private Sub txtMatrixModSize_Change()
'if the Matrix Module size is changed to a value between 1 and 64 then set theMatrix Module size, otherwise beep.
If Val(txtMatrixModSize.Text) > 0 And Val(txtMatrixModSize.Text) < 65 Then
TALBarCd1.MatrixModuleSize = Val(txtMatrixModSize.Text)
Else
Beep
End If
End Sub
Private Sub txtNarrowBW_Change()
'if the narrowbarwidth is changed to a value between 1 and 99 then set the narrowbarwidth, otherwise beep.
If Val(txtNarrowBW.Text) > 0 And Val(txtNarrowBW.Text) < 100 Then
TALBarCd1.NarrowBarWidth = Val(txtNarrowBW.Text)
Else
Beep
End If
End Sub