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 / MDIForm1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2000-07-13  |  11.6 KB  |  300 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Begin VB.MDIForm Mainfrm 
  4.    BackColor       =   &H8000000C&
  5.    Caption         =   "Bar Code Generator"
  6.    ClientHeight    =   4290
  7.    ClientLeft      =   60
  8.    ClientTop       =   345
  9.    ClientWidth     =   7005
  10.    Icon            =   "MDIForm1.frx":0000
  11.    LinkTopic       =   "MDIForm1"
  12.    LockControls    =   -1  'True
  13.    StartUpPosition =   3  'Windows-Standard
  14.    Begin MSComctlLib.Toolbar Toolbar1 
  15.       Align           =   1  'Oben ausrichten
  16.       Height          =   360
  17.       Left            =   0
  18.       TabIndex        =   1
  19.       Top             =   0
  20.       Width           =   7005
  21.       _ExtentX        =   12356
  22.       _ExtentY        =   635
  23.       ButtonWidth     =   609
  24.       ButtonHeight    =   582
  25.       Appearance      =   1
  26.       Style           =   1
  27.       ImageList       =   "imlToolbarIcons"
  28.       _Version        =   393216
  29.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  30.          NumButtons      =   6
  31.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  32.             Key             =   "Neu"
  33.             Object.ToolTipText     =   "New"
  34.             ImageKey        =   "New"
  35.          EndProperty
  36.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  37.             Style           =   3
  38.          EndProperty
  39.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  40.             Key             =   "Drucken"
  41.             Object.ToolTipText     =   "Print"
  42.             ImageKey        =   "Print"
  43.          EndProperty
  44.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  45.             Key             =   "Kopieren"
  46.             Object.ToolTipText     =   "Copy"
  47.             ImageKey        =   "Copy"
  48.          EndProperty
  49.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  50.             Style           =   3
  51.          EndProperty
  52.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  53.             Key             =   "Zeichnen"
  54.             Object.ToolTipText     =   "Paint"
  55.             ImageKey        =   "Drawing"
  56.          EndProperty
  57.       EndProperty
  58.       Begin VB.CommandButton Command1 
  59.          Caption         =   "Tools..."
  60.          Height          =   255
  61.          Left            =   6240
  62.          TabIndex        =   6
  63.          Top             =   30
  64.          Width           =   735
  65.       End
  66.       Begin VB.TextBox Text3 
  67.          BackColor       =   &H00C0C0C0&
  68.          BorderStyle     =   0  'Kein
  69.          Height          =   285
  70.          Left            =   3960
  71.          Locked          =   -1  'True
  72.          TabIndex        =   5
  73.          Text            =   "C.System:"
  74.          Top             =   50
  75.          Width           =   780
  76.       End
  77.       Begin VB.TextBox Text2 
  78.          BackColor       =   &H00C0C0C0&
  79.          BorderStyle     =   0  'Kein
  80.          Height          =   210
  81.          Left            =   1680
  82.          Locked          =   -1  'True
  83.          TabIndex        =   4
  84.          Text            =   "Code:"
  85.          Top             =   50
  86.          Width           =   495
  87.       End
  88.       Begin VB.ComboBox Combo1 
  89.          Height          =   315
  90.          ItemData        =   "MDIForm1.frx":0442
  91.          Left            =   4800
  92.          List            =   "MDIForm1.frx":044C
  93.          Style           =   2  'Dropdown-Liste
  94.          TabIndex        =   3
  95.          Top             =   0
  96.          Width           =   1335
  97.       End
  98.       Begin VB.TextBox Text1 
  99.          Height          =   285
  100.          Left            =   2280
  101.          MaxLength       =   13
  102.          TabIndex        =   2
  103.          Text            =   "2501007661990"
  104.          Top             =   20
  105.          Width           =   1575
  106.       End
  107.    End
  108.    Begin MSComctlLib.StatusBar StatusBar1 
  109.       Align           =   2  'Unten ausrichten
  110.       Height          =   255
  111.       Left            =   0
  112.       TabIndex        =   0
  113.       Top             =   4035
  114.       Width           =   7005
  115.       _ExtentX        =   12356
  116.       _ExtentY        =   450
  117.       _Version        =   393216
  118.       BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
  119.          NumPanels       =   2
  120.          BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  121.             AutoSize        =   1
  122.             Object.Width           =   10865
  123.             MinWidth        =   9701
  124.          EndProperty
  125.          BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  126.             Style           =   5
  127.             Alignment       =   1
  128.             Object.Width           =   1058
  129.             MinWidth        =   1058
  130.             TextSave        =   "15:40"
  131.          EndProperty
  132.       EndProperty
  133.    End
  134.    Begin MSComctlLib.ImageList imlToolbarIcons 
  135.       Left            =   0
  136.       Top             =   360
  137.       _ExtentX        =   1005
  138.       _ExtentY        =   1005
  139.       BackColor       =   -2147483643
  140.       ImageWidth      =   16
  141.       ImageHeight     =   16
  142.       MaskColor       =   12632256
  143.       _Version        =   393216
  144.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  145.          NumListImages   =   4
  146.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  147.             Picture         =   "MDIForm1.frx":045B
  148.             Key             =   "New"
  149.          EndProperty
  150.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  151.             Picture         =   "MDIForm1.frx":056D
  152.             Key             =   "Print"
  153.          EndProperty
  154.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  155.             Picture         =   "MDIForm1.frx":067F
  156.             Key             =   "Copy"
  157.          EndProperty
  158.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  159.             Picture         =   "MDIForm1.frx":0791
  160.             Key             =   "Drawing"
  161.          EndProperty
  162.       EndProperty
  163.    End
  164. Attribute VB_Name = "Mainfrm"
  165. Attribute VB_GlobalNameSpace = False
  166. Attribute VB_Creatable = False
  167. Attribute VB_PredeclaredId = True
  168. Attribute VB_Exposed = False
  169. Private Sub Combo1_Click()
  170. If Combo1.ListIndex = 0 Then
  171.     Text1.MaxLength = 13
  172. ElseIf Combo1.ListIndex = 1 Then
  173.     Text1.MaxLength = 0
  174. End If
  175. End Sub
  176. Private Sub Command1_Click()
  177. toolfrm.Show
  178. End Sub
  179. Private Sub MDIForm_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  180. If Button = 2 Then
  181.     Me.PopupMenu menues.Popup, , X, Y
  182. End If
  183. End Sub
  184. Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  185. TheX = MsgBox("Do you realy want to exit?", vbYesNo + vbSystemModal + vbQuestion, "Exit?")
  186. If TheX <> vbYes Then
  187.     Cancel = True
  188.     Unload menues
  189.     Unload options
  190. End If
  191. End Sub
  192. Private Sub Text1_Change()
  193. If Len(Text1.text) = 13 And Combo1.ListIndex = 0 Then
  194.     If CheckCode(Text1.text) = False Then
  195.         If repair(Text1.text) <> 0 Then
  196.         StatusBar1.Panels(1).text = "Wrong Checknumber! Maybe you mean: " & repair(Text1.text)
  197.         Else
  198.         StatusBar1.Panels(1).text = "Wrong Code! Only use numbers in EAN-Codes!"
  199.         End If
  200.     Else
  201.         StatusBar1.Panels(1).text = "This Code is Correct"
  202.     End If
  203. End If
  204. End Sub
  205. Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
  206. If KeyCode = vbKeyReturn Then
  207.     If Combo1.ListIndex = 0 Then
  208.             If Len(Text1.text) = 13 Then
  209.                 Mainfrm.ActiveForm.Width = (options.Text1.text)
  210.                 Mainfrm.ActiveForm.Cls
  211.                 Mainfrm.ActiveForm.ScaleMode = 3
  212.                 Mainfrm.ActiveForm.Label1.Visible = True
  213.                 PaintCode Mainfrm.ActiveForm, Mid$(Text1.text, 1, 1), Mid$(Text1.text, 2, 6), Mid$(Text1.text, 8, 6)
  214.                 Mainfrm.ActiveForm.Label1.Caption = Mid$(Text1.text, 1, 1)
  215.                 Mainfrm.ActiveForm.Label2.Caption = Mid$(Text1.text, 2, 6)
  216.                 Mainfrm.ActiveForm.Label3.Caption = Mid$(Text1.text, 8, 6)
  217.                 Mainfrm.ActiveForm.isEAN = True
  218.                 Mainfrm.ActiveForm.Refresh
  219.             Else
  220.                 MsgBox "Error: The lenght of the code is wrong", vbCritical, "Error"
  221.             End If
  222.             ElseIf Combo1.ListIndex = 1 Then
  223.                 Mainfrm.ActiveForm.Cls
  224.                 Mainfrm.ActiveForm.ScaleMode = 1
  225.                 Mainfrm.ActiveForm.Label1.Visible = False
  226.                 Code3of9 Text1.text, Mainfrm.ActiveForm, Mainfrm.ActiveForm.Label1
  227.                 Mainfrm.ActiveForm.Label2 = ""
  228.                 Mainfrm.ActiveForm.Label3 = ""
  229.                 Mainfrm.ActiveForm.isEAN = False
  230.                 Mainfrm.ActiveForm.Refresh
  231.             End If
  232. End If
  233. End Sub
  234. Private Sub Toolbar1_ButtonClick(ByVal Button As MSComCtlLib.Button)
  235.     On Error Resume Next
  236.     Select Case Button.Key
  237.         Case "Neu"
  238.             newBarCode
  239.             If Len(Text1.text) = 13 Then
  240.                 PaintCode Mainfrm.ActiveForm, Mid$(Text1.text, 1, 1), Mid$(Text1.text, 2, 6), Mid$(Text1.text, 8, 6)
  241.                 Mainfrm.ActiveForm.Label1.Caption = Mid$(Text1.text, 1, 1)
  242.                 Mainfrm.ActiveForm.Label2.Caption = Mid$(Text1.text, 2, 6)
  243.                 Mainfrm.ActiveForm.Label3.Caption = Mid$(Text1.text, 8, 6)
  244.                 Mainfrm.ActiveForm.isEAN = True
  245.                 Mainfrm.ActiveForm.Refresh
  246.             Else
  247.                 MsgBox "Error: The lenght of the code is wrong", vbCritical, "Error"
  248.             End If
  249.         Case "Drucken"
  250.             Printfrm.Show
  251.         Case "Kopieren"
  252.             'nichts
  253.         Case "Zeichnen"
  254.             If Combo1.ListIndex = 0 Then
  255.             If Len(Text1.text) = 13 Then
  256.                 Mainfrm.ActiveForm.Width = (options.Text1.text)
  257.                 Mainfrm.ActiveForm.Cls
  258.                 Mainfrm.ActiveForm.ScaleMode = 3
  259.                 Mainfrm.ActiveForm.Label1.Visible = True
  260.                 PaintCode Mainfrm.ActiveForm, Mid$(Text1.text, 1, 1), Mid$(Text1.text, 2, 6), Mid$(Text1.text, 8, 6)
  261.                 Mainfrm.ActiveForm.Label1.Caption = Mid$(Text1.text, 1, 1)
  262.                 Mainfrm.ActiveForm.Label2.Caption = Mid$(Text1.text, 2, 6)
  263.                 Mainfrm.ActiveForm.Label3.Caption = Mid$(Text1.text, 8, 6)
  264.                 Mainfrm.ActiveForm.isEAN = True
  265.                 Mainfrm.ActiveForm.Refresh
  266.             Else
  267.                 MsgBox "Error: The lenght of the code is wrong", vbCritical, "Error"
  268.             End If
  269.             ElseIf Combo1.ListIndex = 1 Then
  270.                 Mainfrm.ActiveForm.Cls
  271.                 Mainfrm.ActiveForm.ScaleMode = 1
  272.                 Mainfrm.ActiveForm.Label1.Visible = False
  273.                 Code3of9 Text1.text, Mainfrm.ActiveForm, Mainfrm.ActiveForm.Label1
  274.                 Mainfrm.ActiveForm.Label2 = ""
  275.                 Mainfrm.ActiveForm.Label3 = ""
  276.                 Mainfrm.ActiveForm.isEAN = False
  277.                 Mainfrm.ActiveForm.Refresh
  278.             End If
  279.     End Select
  280. End Sub
  281. Private Sub MDIForm_Load()
  282. ReDim bcode(1)
  283. ReDim FState(1)
  284. bcode(1).Tag = 1
  285. FState(1).Dirty = False
  286. Combo1.ListIndex = 0
  287. PaintCode Mainfrm.ActiveForm, Mid$(Text1.text, 1, 1), Mid$(Text1.text, 2, 6), Mid$(Text1.text, 8, 6)
  288. Mainfrm.ActiveForm.Label1.Caption = Mid$(Text1.text, 1, 1)
  289. Mainfrm.ActiveForm.Label2.Caption = Mid$(Text1.text, 2, 6)
  290. Mainfrm.ActiveForm.Label3.Caption = Mid$(Text1.text, 8, 6)
  291. Mainfrm.ActiveForm.isEAN = True
  292. Mainfrm.ActiveForm.Refresh
  293. TheX = GetSetting("Bar Code Generator", "Settings", "BGPicture", "")
  294. If TheX <> "" Then
  295.     Me.Picture = LoadPicture(TheX)
  296. End If
  297. Text2.BackColor = menues.BackColor
  298. Text3.BackColor = menues.BackColor
  299. End Sub
  300.