home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Visual Basic new SourceCode and Projects / Barcode Generator 2.0 / DBfrm.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2000-06-23  |  8.5 KB  |  281 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Begin VB.Form DBfrm 
  4.    BorderStyle     =   4  'Festes Werkzeugfenster
  5.    Caption         =   "Database"
  6.    ClientHeight    =   2055
  7.    ClientLeft      =   45
  8.    ClientTop       =   285
  9.    ClientWidth     =   4680
  10.    Icon            =   "DBfrm.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    LockControls    =   -1  'True
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   137
  16.    ScaleMode       =   3  'Pixel
  17.    ScaleWidth      =   312
  18.    ShowInTaskbar   =   0   'False
  19.    StartUpPosition =   3  'Windows-Standard
  20.    Begin VB.CommandButton Upd 
  21.       Caption         =   "Update"
  22.       Height          =   375
  23.       Left            =   3480
  24.       TabIndex        =   12
  25.       Top             =   600
  26.       Width           =   1095
  27.    End
  28.    Begin VB.TextBox Product 
  29.       Height          =   285
  30.       Left            =   120
  31.       MaxLength       =   20
  32.       TabIndex        =   11
  33.       Text            =   "<none>"
  34.       Top             =   1560
  35.       Width           =   1575
  36.    End
  37.    Begin VB.TextBox Manufacturer 
  38.       Height          =   285
  39.       Left            =   120
  40.       MaxLength       =   20
  41.       TabIndex        =   10
  42.       Text            =   "<none>"
  43.       Top             =   960
  44.       Width           =   1575
  45.    End
  46.    Begin VB.CommandButton Gen 
  47.       Caption         =   "Generate"
  48.       Height          =   375
  49.       Left            =   3480
  50.       TabIndex        =   8
  51.       Top             =   1080
  52.       Width           =   1095
  53.    End
  54.    Begin VB.CommandButton Save 
  55.       Caption         =   "Save as new"
  56.       Height          =   375
  57.       Left            =   3480
  58.       TabIndex        =   7
  59.       Top             =   120
  60.       Width           =   1095
  61.    End
  62.    Begin VB.TextBox Country 
  63.       Height          =   285
  64.       Left            =   120
  65.       MaxLength       =   15
  66.       TabIndex        =   4
  67.       Text            =   "<none>"
  68.       Top             =   360
  69.       Width           =   1575
  70.    End
  71.    Begin VB.ComboBox FCode 
  72.       Height          =   315
  73.       Left            =   1800
  74.       Sorted          =   -1  'True
  75.       TabIndex        =   1
  76.       Text            =   "Combo1"
  77.       Top             =   360
  78.       Width           =   1455
  79.    End
  80.    Begin MSComDlg.CommonDialog CD1 
  81.       Left            =   4080
  82.       Top             =   1560
  83.       _ExtentX        =   847
  84.       _ExtentY        =   847
  85.       _Version        =   393216
  86.       DialogTitle     =   "Open Image"
  87.       Filter          =   "Alle dateien | *.*"
  88.    End
  89.    Begin VB.Line Line4 
  90.       BorderStyle     =   3  'Punkt
  91.       X1              =   216
  92.       X2              =   120
  93.       Y1              =   128
  94.       Y2              =   128
  95.    End
  96.    Begin VB.Line Line3 
  97.       BorderStyle     =   3  'Punkt
  98.       X1              =   120
  99.       X2              =   216
  100.       Y1              =   48
  101.       Y2              =   48
  102.    End
  103.    Begin VB.Line Line2 
  104.       BorderStyle     =   3  'Punkt
  105.       X1              =   216
  106.       X2              =   216
  107.       Y1              =   128
  108.       Y2              =   48
  109.    End
  110.    Begin VB.Line Line1 
  111.       BorderStyle     =   3  'Punkt
  112.       X1              =   120
  113.       X2              =   120
  114.       Y1              =   128
  115.       Y2              =   48
  116.    End
  117.    Begin VB.Image Image1 
  118.       Height          =   1215
  119.       Left            =   1800
  120.       Stretch         =   -1  'True
  121.       Top             =   720
  122.       Width           =   1455
  123.    End
  124.    Begin VB.Label Label4 
  125.       AutoSize        =   -1  'True
  126.       Caption         =   "Code:"
  127.       Height          =   195
  128.       Left            =   1800
  129.       TabIndex        =   5
  130.       Top             =   120
  131.       Width           =   420
  132.    End
  133.    Begin VB.Label Label3 
  134.       AutoSize        =   -1  'True
  135.       Caption         =   "Product:"
  136.       Height          =   195
  137.       Left            =   120
  138.       TabIndex        =   3
  139.       Top             =   1320
  140.       Width           =   600
  141.    End
  142.    Begin VB.Label Label2 
  143.       AutoSize        =   -1  'True
  144.       Caption         =   "Country:"
  145.       Height          =   195
  146.       Left            =   120
  147.       TabIndex        =   2
  148.       Top             =   120
  149.       Width           =   585
  150.    End
  151.    Begin VB.Label Label1 
  152.       AutoSize        =   -1  'True
  153.       Caption         =   "Manufacturer:"
  154.       Height          =   195
  155.       Left            =   120
  156.       TabIndex        =   0
  157.       Top             =   720
  158.       Width           =   990
  159.    End
  160.    Begin VB.Label Label5 
  161.       AutoSize        =   -1  'True
  162.       Caption         =   "No Picture"
  163.       Height          =   195
  164.       Left            =   2160
  165.       TabIndex        =   6
  166.       Top             =   960
  167.       Width           =   750
  168.    End
  169.    Begin VB.Label Label6 
  170.       AutoSize        =   -1  'True
  171.       Caption         =   "97x81"
  172.       Height          =   195
  173.       Left            =   2310
  174.       TabIndex        =   9
  175.       Top             =   1320
  176.       Width           =   435
  177.    End
  178.    Begin VB.Label ppath 
  179.       BackStyle       =   0  'Transparent
  180.       Height          =   195
  181.       Left            =   1920
  182.       TabIndex        =   13
  183.       Top             =   1560
  184.       Visible         =   0   'False
  185.       Width           =   1200
  186.    End
  187. Attribute VB_Name = "DBfrm"
  188. Attribute VB_GlobalNameSpace = False
  189. Attribute VB_Creatable = False
  190. Attribute VB_PredeclaredId = True
  191. Attribute VB_Exposed = False
  192. Public Position As Long
  193. Public LastRecord As Long
  194. Private Sub FCode_Click()
  195. Dim FileNum As Integer, RecLength As Long, CodeDB As DBcode
  196. RecLength = LenB(CodeDB)
  197. FileNum = FreeFile
  198. Open toolfrm.Text2.text For Random As FileNum Len = RecLength
  199. Get FileNum, GetPosition(FCode.text) + 1, CodeDB
  200. Country.text = Trim$(CodeDB.Country)
  201. Manufacturer.text = Trim$(CodeDB.Manufacturer)
  202. Product.text = Trim$(CodeDB.Product)
  203. If Trim$(CodeDB.PicPath) <> "" Then
  204.     ppath.Caption = Trim$(CodeDB.PicPath)
  205.     Image1.Picture = LoadPicture(Trim$(CodeDB.PicPath))
  206.     Label5.Visible = False
  207.     Label6.Visible = False
  208.     ppath.Caption = ""
  209.     Label5.Visible = True
  210.     Label6.Visible = True
  211. End If
  212. Close FileNum
  213. End Sub
  214. Private Sub Form_Load()
  215. Dim FileNum As Integer, RecLength As Long, CodeDB As DBcode
  216. RecLength = LenB(CodeDB)
  217. FileNum = FreeFile
  218. Open toolfrm.Text2.text For Random As FileNum Len = RecLength
  219. Position = 1
  220. Get FileNum, 1, CodeDB
  221. If IsNumeric(CLng(Trim$(CodeDB.FullCode))) = True Then
  222.     LastRecord = CLng(Trim$(CodeDB.FullCode))
  223.     LastRecord = 1
  224. End If
  225. If LastRecord > 1 Then
  226. For Position = 2 To LastRecord
  227. Get FileNum, Position, CodeDB
  228. FCode.AddItem Trim$("<" & (Position - 1) & "> " & CodeDB.FullCode)
  229. End If
  230. Close FileNum
  231. End Sub
  232. Private Sub Gen_Click()
  233. newBarCode
  234. Mainfrm.ActiveForm.Caption = Product.text
  235. PaintCode Mainfrm.ActiveForm, Mid$(Right$(FCode.text, 13), 1, 1), Mid$(Right$(FCode.text, 13), 2, 6), Mid$(Right$(FCode.text, 13), 8, 6)
  236. Mainfrm.ActiveForm.Label1.Caption = Mid$(Right$(FCode.text, 13), 1, 1)
  237. Mainfrm.ActiveForm.Label2.Caption = Mid$(Right$(FCode.text, 13), 2, 6)
  238. Mainfrm.ActiveForm.Label3.Caption = Mid$(Right$(FCode.text, 13), 8, 6)
  239. Mainfrm.ActiveForm.isEAN = True
  240. Mainfrm.ActiveForm.Refresh
  241. End Sub
  242. Private Sub Image1_Click()
  243. On Error Resume Next
  244. CD1.ShowOpen
  245. If CD1.FileName <> "" Then
  246.     Image1.Picture = LoadPicture(CD1.FileName)
  247.     ppath.Caption = CD1.FileName
  248.     End If
  249. End Sub
  250. Private Sub Save_Click()
  251. Dim FileNum As Integer, RecLength As Long, CodeDB As DBcode
  252. RecLength = LenB(CodeDB)
  253. FileNum = FreeFile
  254. Open toolfrm.Text2.text For Random As FileNum Len = RecLength
  255. CodeDB.Country = Country.text
  256. CodeDB.Manufacturer = Manufacturer.text
  257. CodeDB.Product = Product.text
  258. CodeDB.FullCode = Right$(FCode.text, 13)
  259. CodeDB.PicPath = ppath.Caption
  260. Put FileNum, LastRecord + 1, CodeDB
  261. LastRecord = LastRecord + 1
  262. CodeDB.FullCode = LastRecord
  263. Put FileNum, 1, CodeDB
  264. Close FileNum
  265. End Sub
  266. Private Sub Upd_Click()
  267. Dim FileNum As Integer, RecLength As Long, CodeDB As DBcode
  268. RecLength = LenB(CodeDB)
  269. FileNum = FreeFile
  270. Open toolfrm.Text2.text For Random As FileNum Len = RecLength
  271. CodeDB.Country = Country.text
  272. CodeDB.Manufacturer = Manufacturer.text
  273. CodeDB.Product = Product.text
  274. CodeDB.FullCode = Right$(FCode.text, 13)
  275. CodeDB.PicPath = ppath.Caption
  276. Put FileNum, (GetPosition(FCode.text) + 1), CodeDB
  277. CodeDB.FullCode = LastRecord
  278. Put FileNum, 1, CodeDB
  279. Close FileNum
  280. End Sub
  281.