⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmsetpara2.frm

📁 为程口编程源码
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmSetpara2 
   Caption         =   "参数设置 2:处警参数"
   ClientHeight    =   6705
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6765
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   6705
   ScaleWidth      =   6765
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton cmdPrev 
      Caption         =   "上一步"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Left            =   2700
      TabIndex        =   6
      Top             =   6165
      Width           =   1335
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取消"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Left            =   5160
      TabIndex        =   5
      Top             =   6165
      Width           =   1335
   End
   Begin VB.CommandButton cmdEnter 
      Caption         =   "下一步"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Left            =   240
      TabIndex        =   4
      Top             =   6165
      Width           =   1335
   End
   Begin VB.CommandButton cmdEdit 
      Caption         =   "修    改"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   5400
      TabIndex        =   3
      Top             =   2385
      Width           =   1335
   End
   Begin VB.CommandButton cmdDelete 
      Caption         =   "删    除"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   5385
      TabIndex        =   2
      Top             =   1365
      Width           =   1335
   End
   Begin VB.CommandButton cmdAdd 
      Caption         =   "添    加"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   5385
      TabIndex        =   1
      Top             =   480
      Width           =   1335
   End
   Begin MSComctlLib.ListView lvwPara 
      Height          =   5295
      Left            =   240
      TabIndex        =   0
      Top             =   360
      Width           =   5000
      _ExtentX        =   8811
      _ExtentY        =   9340
      LabelEdit       =   1
      LabelWrap       =   -1  'True
      HideSelection   =   0   'False
      _Version        =   393217
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      BorderStyle     =   1
      Appearance      =   1
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      NumItems        =   0
   End
   Begin VB.Line Line2 
      BorderColor     =   &H80000005&
      BorderWidth     =   2
      X1              =   120
      X2              =   6600
      Y1              =   6000
      Y2              =   6000
   End
   Begin VB.Line Line1 
      X1              =   120
      X2              =   6600
      Y1              =   5970
      Y2              =   5970
   End
End
Attribute VB_Name = "frmSetpara2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub cmdAdd_Click()
  frmCujpara.Caption = "添加处警"
  frmCujpara.Show vbModal
End Sub

Private Sub cmdCancel_Click()
   Unload Me
End Sub

Private Sub cmdDelete_Click()
  frmCujpara.Caption = "删除处警"
 '屏蔽frmCujpara上的textbox和optionbutton
  frmCujpara.Text1.Enabled = False
  frmCujpara.Text2.Enabled = False
  frmCujpara.Text3.Enabled = False
  frmCujpara.Text4.Enabled = False
  frmCujpara.Option1.Enabled = False
  frmCujpara.Option2.Enabled = False
  frmCujpara.Option3.Enabled = False
  frmCujpara.Option4.Enabled = False
  frmCujpara.Show vbModal
End Sub

Private Sub cmdEdit_Click()
  frmCujpara.Caption = "修改处警"
  frmCujpara.Show vbModal
End Sub

Private Sub cmdEnter_Click()
   Me.Hide
   frmSetpara3.Show vbModal
End Sub

Private Sub cmdPrev_Click()
   Me.Hide
   frmSetpara.Show vbModal
End Sub

Private Sub Form_Load()
      Call makecolumns
      Call initcj
End Sub

Private Sub Form_Resize()
    Me.Height = frmSetpara.Height
    Me.Width = frmSetpara.Width
    Me.Left = frmSetpara.Left
    Me.Top = frmSetpara.Top
End Sub
'建表头
Private Sub makecolumns()
    lvwPara.View = lvwReport
    lvwPara.FullRowSelect = True
    lvwPara.ColumnHeaders.Clear
    lvwPara.ColumnHeaders.Add , , "处警名称", lvwPara.Width / 6
    lvwPara.ColumnHeaders.Add , , "端口属性", lvwPara.Width / 6
    lvwPara.ColumnHeaders.Add , , "端口编号", lvwPara.Width / 6
    lvwPara.ColumnHeaders.Add , , "动作类型", lvwPara.Width / 6
    lvwPara.ColumnHeaders.Add , , "信号发码", lvwPara.Width / 6
    lvwPara.ColumnHeaders.Add , , "电话号码", lvwPara.Width / 6
End Sub

Private Sub initcj()
Dim rs As ADODB.Recordset
    Set rs = New ADODB.Recordset
Dim str As String
    str = "select * from ChujingSet"
    rs.Open str, cn, adOpenDynamic, adLockOptimistic
    
    lvwPara.ListItems.Clear
    
    If addlistitem(rs) Then chkLine = 1
End Sub
'将打开的表r加入listview的item中,如果r不为空集的话,则返回true,反之为false
Private Function addlistitem(r As ADODB.Recordset) As Boolean
          If r.EOF Or r.BOF Then
                   addlistitem = False
                   Exit Function
          End If
     
               addlistitem = True
     
             r.MoveFirst
             
  While Not r.EOF And Not r.BOF
  Dim str1, str2, str3, str4, str5, str6 As String
     
           str1 = r!cjname
     
         If IsNull(str1) Then
               MsgBox ("此纪录无主键")
               Exit Function
         End If
         
         If IsNull(r!porperty) Then
                   str2 = "-"
         Else
                 str2 = r!porperty
         End If
     
         If IsNull(r!Number) Then
                 str3 = "-"
         Else
                 str3 = r!Number
         End If
     
         If IsNull(r!typeact) Then
                 str4 = "-"
         Else
                str4 = r!typeact
         End If
         
         If IsNull(r!infocode) Then
                str5 = "-"
         Else
               str5 = r!infocode
         End If
         
         If IsNull(r!telnumber) Then
                str6 = "-"
         Else
                str6 = r!telnumber
        End If
     
     Select Case str4
        Case "-"
            str5 = "-"
            str6 = "-"
        Case "拨号"
            str5 = "-"
        Case "发码"
            str6 = "-"
      End Select
     
     Set mLogItem = lvwPara.ListItems.Add(Text:=str1)
      mLogItem.ListSubItems.Add Text:=str2
      mLogItem.ListSubItems.Add Text:=str3
      mLogItem.ListSubItems.Add Text:=str4
      mLogItem.ListSubItems.Add Text:=str5
      mLogItem.ListSubItems.Add Text:=str6
      
      r.MoveNext
  Wend
      
      r.Close
End Function

Private Sub lvwPara_ItemClick(ByVal Item As MSComctlLib.ListItem)
    chkLine = Item.index
End Sub


⌨️ 快捷键说明

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