frmcommodityclassproperty.frm

来自「很好! 很实用! 免费!」· FRM 代码 · 共 395 行 · 第 1/2 页

FRM
395
字号
               Picture         =   "frmCommodityClassProperty.frx":0A84
               Key             =   ""
            EndProperty
            BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmCommodityClassProperty.frx":0FC6
               Key             =   ""
            EndProperty
            BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmCommodityClassProperty.frx":1160
               Key             =   ""
            EndProperty
            BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmCommodityClassProperty.frx":16A2
               Key             =   ""
            EndProperty
            BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmCommodityClassProperty.frx":19F6
               Key             =   ""
            EndProperty
            BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmCommodityClassProperty.frx":1D4A
               Key             =   ""
            EndProperty
            BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmCommodityClassProperty.frx":228C
               Key             =   ""
            EndProperty
            BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmCommodityClassProperty.frx":27CE
               Key             =   ""
            EndProperty
            BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmCommodityClassProperty.frx":2D10
               Key             =   ""
            EndProperty
         EndProperty
      End
      Begin MSComctlLib.ImageList toolbarImageList2 
         Left            =   8040
         Top             =   0
         _ExtentX        =   1005
         _ExtentY        =   1005
         BackColor       =   -2147483643
         ImageWidth      =   16
         ImageHeight     =   15
         MaskColor       =   12632256
         _Version        =   393216
         BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
            NumListImages   =   11
            BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmCommodityClassProperty.frx":2E1A
               Key             =   ""
            EndProperty
            BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmCommodityClassProperty.frx":335C
               Key             =   ""
            EndProperty
            BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmCommodityClassProperty.frx":389E
               Key             =   ""
            EndProperty
            BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmCommodityClassProperty.frx":3DE0
               Key             =   ""
            EndProperty
            BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmCommodityClassProperty.frx":3F7C
               Key             =   ""
            EndProperty
            BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmCommodityClassProperty.frx":44BE
               Key             =   ""
            EndProperty
            BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmCommodityClassProperty.frx":4812
               Key             =   ""
            EndProperty
            BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmCommodityClassProperty.frx":4B66
               Key             =   ""
            EndProperty
            BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmCommodityClassProperty.frx":50A8
               Key             =   ""
            EndProperty
            BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmCommodityClassProperty.frx":55EA
               Key             =   ""
            EndProperty
            BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmCommodityClassProperty.frx":5B2C
               Key             =   ""
            EndProperty
         EndProperty
      End
   End
   Begin VB.Label lblTitle 
      AutoSize        =   -1  'True
      Caption         =   "类属性列表"
      Height          =   195
      Left            =   120
      TabIndex        =   9
      Top             =   720
      Width           =   900
   End
End
Attribute VB_Name = "frmCommodityClassProperty"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
    
Option Explicit
Public sClassID As String
Private Sub OKButton_Click()

End Sub

Private Sub Form_Load()
    cbDataType.AddItem "字符"
    cbDataType.AddItem "数字"
    cbDataType.AddItem "日期"
    cbDataType.ListIndex = 0
    
    Dim i As Integer
    For i = 11 To 20
        cbFieldName.AddItem "F" + CStr(i)
    Next i
    cbFieldName.ListIndex = 0
    Call RefreshData
End Sub
Private Sub RefreshData()
Dim objClassProperty As New clsCommodityClassProperty
    GList1.Clear
    GList1.RelativeList objClassProperty.GetList("*", " ClassID=" + CheckString(sClassID), "FieldName"), "FieldName"
End Sub

Private Sub GList1_Click()
    If GList1.ListIndex = -1 Then Exit Sub
    
    txtName.Text = GList1.Item("Name", GList1.ListIndex)
    cbFieldName.Text = GList1.Item("FieldName", GList1.ListIndex)
    Dim i As Integer
    For i = 0 To cbDataType.ListCount - 1
        If cbDataType.ItemData(i) = GList1.Item("DataType", GList1.ListIndex) Then
            cbDataType.ListIndex = i
            Exit For
        End If
    Next i
    
End Sub

Private Sub topToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
Dim objClass As New clsCommodityClassProperty
    Select Case Button.Key
        Case "Insert"
            If CheckSave() Then
                With objClass
                    .m_ClassID = sClassID
                    .m_DateType = cbDataType.Text
                    .m_FieldName = cbFieldName.Text
                    .m_Name = txtName.Text
                    .m_ID = newGUID()
                    If .Insert() Then
                        Call RefreshData
                    End If
                End With
            End If
        Case "Update"
            If CheckSave() Then
                With objClass
                    .m_ClassID = sClassID
                    .m_Name = txtName.Text
                    .m_DateType = cbDataType.Text
                    .m_FieldName = cbFieldName.Text
                    .m_ID = GList1.Item("ID", GList1.ListIndex)
                    If .Update Then
                        Call RefreshData
                    End If
                End With
            End If
        Case "Delete"
                With objClass
                    .m_ID = GList1.Item("ID", GList1.ListIndex)
                    If .Delete() Then
                        Call RefreshData
                    End If
                End With
        Case "Exit"
            Unload Me
    End Select
End Sub
Private Function CheckSave() As Boolean
    CheckSave = -True
    If Len(Trim(txtName.Text)) = 0 Then CheckSave = False
End Function

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?