home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD13440162001.psc / fmEdit.frm (.txt) next >
Encoding:
Visual Basic Form  |  2001-01-05  |  7.7 KB  |  246 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
  3. Begin VB.Form fmEdit 
  4.    BackColor       =   &H00800000&
  5.    Caption         =   "Add Item"
  6.    ClientHeight    =   2325
  7.    ClientLeft      =   60
  8.    ClientTop       =   345
  9.    ClientWidth     =   5820
  10.    Icon            =   "fmEdit.frx":0000
  11.    LinkTopic       =   "Form2"
  12.    ScaleHeight     =   2325
  13.    ScaleWidth      =   5820
  14.    StartUpPosition =   2  'CenterScreen
  15.    Begin VB.ComboBox cboColor 
  16.       Height          =   315
  17.       Left            =   3480
  18.       TabIndex        =   8
  19.       Top             =   1320
  20.       Width           =   2055
  21.    End
  22.    Begin VB.TextBox txtPartNum 
  23.       Alignment       =   2  'Center
  24.       BeginProperty Font 
  25.          Name            =   "MS Sans Serif"
  26.          Size            =   8.25
  27.          Charset         =   0
  28.          Weight          =   700
  29.          Underline       =   0   'False
  30.          Italic          =   0   'False
  31.          Strikethrough   =   0   'False
  32.       EndProperty
  33.       Height          =   345
  34.       Left            =   1170
  35.       TabIndex        =   2
  36.       Top             =   1320
  37.       Width           =   1950
  38.    End
  39.    Begin VB.CommandButton cmdCancel 
  40.       BackColor       =   &H00FFC0C0&
  41.       Caption         =   "Cancel"
  42.       BeginProperty Font 
  43.          Name            =   "MS Sans Serif"
  44.          Size            =   8.25
  45.          Charset         =   0
  46.          Weight          =   700
  47.          Underline       =   0   'False
  48.          Italic          =   0   'False
  49.          Strikethrough   =   0   'False
  50.       EndProperty
  51.       Height          =   375
  52.       Left            =   1680
  53.       Style           =   1  'Graphical
  54.       TabIndex        =   4
  55.       Top             =   1845
  56.       Width           =   1425
  57.    End
  58.    Begin MSComDlg.CommonDialog dlgB 
  59.       Left            =   3360
  60.       Top             =   1800
  61.       _ExtentX        =   847
  62.       _ExtentY        =   847
  63.       _Version        =   393216
  64.    End
  65.    Begin VB.CommandButton cmdAddItem 
  66.       BackColor       =   &H00FFC0C0&
  67.       Caption         =   "Add Item"
  68.       BeginProperty Font 
  69.          Name            =   "MS Sans Serif"
  70.          Size            =   8.25
  71.          Charset         =   0
  72.          Weight          =   700
  73.          Underline       =   0   'False
  74.          Italic          =   0   'False
  75.          Strikethrough   =   0   'False
  76.       EndProperty
  77.       Height          =   375
  78.       Left            =   120
  79.       Style           =   1  'Graphical
  80.       TabIndex        =   3
  81.       Top             =   1845
  82.       Width           =   1455
  83.    End
  84.    Begin VB.CommandButton cmdAddPic 
  85.       BackColor       =   &H00FFC0C0&
  86.       Caption         =   "Add Picture..."
  87.       BeginProperty Font 
  88.          Name            =   "MS Sans Serif"
  89.          Size            =   8.25
  90.          Charset         =   0
  91.          Weight          =   700
  92.          Underline       =   0   'False
  93.          Italic          =   0   'False
  94.          Strikethrough   =   0   'False
  95.       EndProperty
  96.       Height          =   390
  97.       Left            =   180
  98.       Style           =   1  'Graphical
  99.       TabIndex        =   0
  100.       Top             =   225
  101.       Width           =   1365
  102.    End
  103.    Begin VB.TextBox txtItem 
  104.       BeginProperty Font 
  105.          Name            =   "MS Sans Serif"
  106.          Size            =   8.25
  107.          Charset         =   0
  108.          Weight          =   700
  109.          Underline       =   0   'False
  110.          Italic          =   0   'False
  111.          Strikethrough   =   0   'False
  112.       EndProperty
  113.       Height          =   345
  114.       Left            =   1170
  115.       TabIndex        =   1
  116.       Top             =   720
  117.       Width           =   4440
  118.    End
  119.    Begin VB.Label Label2 
  120.       BackColor       =   &H00800000&
  121.       Caption         =   "Part #"
  122.       BeginProperty Font 
  123.          Name            =   "MS Sans Serif"
  124.          Size            =   12
  125.          Charset         =   0
  126.          Weight          =   700
  127.          Underline       =   0   'False
  128.          Italic          =   0   'False
  129.          Strikethrough   =   0   'False
  130.       EndProperty
  131.       ForeColor       =   &H00FFFFFF&
  132.       Height          =   360
  133.       Left            =   270
  134.       TabIndex        =   7
  135.       Top             =   1320
  136.       Width           =   795
  137.    End
  138.    Begin VB.Label lblPicString 
  139.       BackColor       =   &H00800000&
  140.       BeginProperty Font 
  141.          Name            =   "MS Sans Serif"
  142.          Size            =   8.25
  143.          Charset         =   0
  144.          Weight          =   700
  145.          Underline       =   0   'False
  146.          Italic          =   0   'False
  147.          Strikethrough   =   0   'False
  148.       EndProperty
  149.       ForeColor       =   &H00FFFFFF&
  150.       Height          =   375
  151.       Left            =   1635
  152.       TabIndex        =   6
  153.       Top             =   225
  154.       Width           =   3990
  155.    End
  156.    Begin VB.Label Label1 
  157.       BackColor       =   &H00800000&
  158.       Caption         =   "Name"
  159.       BeginProperty Font 
  160.          Name            =   "MS Sans Serif"
  161.          Size            =   12
  162.          Charset         =   0
  163.          Weight          =   700
  164.          Underline       =   0   'False
  165.          Italic          =   0   'False
  166.          Strikethrough   =   0   'False
  167.       EndProperty
  168.       ForeColor       =   &H00FFFFFF&
  169.       Height          =   375
  170.       Left            =   285
  171.       TabIndex        =   5
  172.       Top             =   765
  173.       Width           =   780
  174.    End
  175. Attribute VB_Name = "fmEdit"
  176. Attribute VB_GlobalNameSpace = False
  177. Attribute VB_Creatable = False
  178. Attribute VB_PredeclaredId = True
  179. Attribute VB_Exposed = False
  180. Public Sub cmdAddItem_Click()
  181.     NameString = txtItem.Text
  182.     PicString = lblPicString.Caption
  183.     PNumber = txtPartNum.Text
  184.     ColorVal = cboColor.Text
  185.     'i = i + 1
  186.     If txtItem.Text = "" Then
  187.         Dim Result
  188.         Result = MsgBox("Please enter a name for the label.", , "No Label Name")
  189.         Exit Sub
  190.     ElseIf txtPartNum.Text = "" Then
  191.         Dim Result2
  192.         Result2 = MsgBox("Please enter a part number for for this label.", , "No Part Number")
  193.         Exit Sub
  194.     End If
  195.     Call fmMain.Save2File
  196.     AddItem = True
  197.     fmMain.lstItems.Refresh
  198.     Unload Me
  199. End Sub
  200. Private Sub cmdAddPic_Click()
  201.         On Error GoTo OpenError
  202.         'Do While FileNum2 > 0
  203.             'Close FileNum2
  204.             'FileNum2 = FileNum2 - 1
  205.         'Loop
  206.         
  207.         'To Do
  208.         'set the flags and attributes of the
  209.         'common dialog control
  210.         SFile = "All Image Files (*.*)|*.*|"
  211.         SFile = SFile + "BMP Files (*.bmp)|*.bmp|  "
  212.         SFile = SFile + "GIF Files (*.gif)|*.gif|  "
  213.         SFile = SFile + "JPG Files (*.jpg)|*.jpg|  "
  214.         dlgB.Filter = SFile
  215.         dlgB.InitDir = "C:\Program Files\LabelMaker"
  216.         dlgB.FilterIndex = 1
  217.         dlgB.ShowOpen
  218.         PicString = dlgB.FileName
  219.         'dlgB.Flags = cdlOFNCreatePrompt
  220.         If Len(PicString) = 0 Then
  221.             Exit Sub
  222.         End If
  223.         lblPicString.Caption = PicString
  224.         'FileNum2 = FreeFile
  225. OpenError:
  226.     Exit Sub
  227. End Sub
  228. Private Sub cmdCancel_Click()
  229.     txtItem.Text = ""
  230.     txtPartNum.Text = ""
  231.     lblPicString.Caption = ""
  232.     cboColor.Clear
  233.     Unload Me
  234. End Sub
  235. Private Sub Form_Activate()
  236.     cmdAddPic.SetFocus
  237.     cboColor.AddItem "NONE"
  238.     cboColor.AddItem "Green"
  239.     cboColor.AddItem "Blue"
  240.     cboColor.AddItem "Red"
  241.     cboColor.AddItem "Pink"
  242.     cboColor.AddItem "Black"
  243.     cboColor.AddItem "Gray"
  244.     cboColor.Text = "Select a border"
  245. End Sub
  246.