home *** CD-ROM | disk | FTP | other *** search
/ Master 95 #1 / MASTER95_1.iso / microsof / vbasic4 / vb4-6.cab / addudp.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-07-26  |  3.6 KB  |  129 lines

  1. VERSION 4.00
  2. Begin VB.Form frmAddUDP 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "Add User Defined Property"
  5.    ClientHeight    =   1950
  6.    ClientLeft      =   2040
  7.    ClientTop       =   2670
  8.    ClientWidth     =   4710
  9.    Height          =   2355
  10.    HelpContextID   =   2016119
  11.    Icon            =   "ADDUDP.frx":0000
  12.    Left            =   1980
  13.    LinkTopic       =   "Form1"
  14.    LockControls    =   -1  'True
  15.    MaxButton       =   0   'False
  16.    MinButton       =   0   'False
  17.    ScaleHeight     =   1950
  18.    ScaleWidth      =   4710
  19.    Top             =   2325
  20.    Width           =   4830
  21.    Begin VB.TextBox txtValue 
  22.       Height          =   285
  23.       Left            =   120
  24.       TabIndex        =   2
  25.       Top             =   1560
  26.       Width           =   2655
  27.    End
  28.    Begin VB.ComboBox cboPropType 
  29.       Height          =   300
  30.       ItemData        =   "ADDUDP.frx":030A
  31.       Left            =   120
  32.       List            =   "ADDUDP.frx":032A
  33.       Style           =   2  'Dropdown List
  34.       TabIndex        =   1
  35.       Top             =   960
  36.       Width           =   2655
  37.    End
  38.    Begin VB.TextBox txtName 
  39.       Height          =   285
  40.       Left            =   120
  41.       TabIndex        =   0
  42.       Top             =   360
  43.       Width           =   2655
  44.    End
  45.    Begin VB.CommandButton cmdCancel 
  46.       Cancel          =   -1  'True
  47.       Caption         =   "&Cancel"
  48.       Height          =   375
  49.       Left            =   3000
  50.       TabIndex        =   4
  51.       Top             =   840
  52.       Width           =   1575
  53.    End
  54.    Begin VB.CommandButton cmdOK 
  55.       Caption         =   "&OK"
  56.       Default         =   -1  'True
  57.       Enabled         =   0   'False
  58.       Height          =   375
  59.       Left            =   3000
  60.       TabIndex        =   3
  61.       Top             =   360
  62.       Width           =   1575
  63.    End
  64.    Begin VB.Label lblLabels 
  65.       AutoSize        =   -1  'True
  66.       Caption         =   "Value:"
  67.       Height          =   195
  68.       Index           =   2
  69.       Left            =   120
  70.       TabIndex        =   7
  71.       Top             =   1320
  72.       Width           =   450
  73.    End
  74.    Begin VB.Label lblLabels 
  75.       AutoSize        =   -1  'True
  76.       Caption         =   "Type:"
  77.       Height          =   195
  78.       Index           =   1
  79.       Left            =   120
  80.       TabIndex        =   6
  81.       Top             =   720
  82.       Width           =   405
  83.    End
  84.    Begin VB.Label lblLabels 
  85.       AutoSize        =   -1  'True
  86.       Caption         =   "Name:"
  87.       Height          =   195
  88.       Index           =   0
  89.       Left            =   120
  90.       TabIndex        =   5
  91.       Top             =   120
  92.       Width           =   465
  93.    End
  94. Attribute VB_Name = "frmAddUDP"
  95. Attribute VB_Creatable = False
  96. Attribute VB_Exposed = False
  97. Option Explicit
  98. Sub cmdCancel_Click()
  99.   Unload Me
  100. End Sub
  101. Sub cmdOK_Click()
  102.   On Error GoTo OKErr
  103.   Dim prpTmp As Property
  104.   'create the property using all of the arguments in
  105.   'the create function
  106.   Set prpTmp = gPropObject.CreateProperty _
  107.                (txtName.Text, _
  108.                 cboPropType.ItemData(cboPropType.ListIndex), _
  109.                 txtValue.Text)
  110.                 
  111.   'append the new property to the object
  112.   gPropObject.Properties.Append prpTmp
  113.   Unload Me
  114.   Exit Sub
  115. OKErr:
  116.   ShowError
  117.   Exit Sub
  118. End Sub
  119. Sub Form_Load()
  120.   cboPropType.ListIndex = 8
  121. End Sub
  122. Sub txtName_Change()
  123.   If Len(txtName.Text) > 0 Then
  124.     cmdOK.Enabled = True
  125.   Else
  126.     cmdOK.Enabled = False
  127.   End If
  128. End Sub
  129.