VERSION 5.00
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmComm 
   Caption         =   "CE-AJ31演示程序"
   ClientHeight    =   6255
   ClientLeft      =   60
   ClientTop       =   630
   ClientWidth     =   8565
   Icon            =   "frmComm.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   6255
   ScaleMode       =   0  'User
   ScaleTop        =   2000
   ScaleWidth      =   8565
   Begin MSComctlLib.ListView LV 
      Height          =   5415
      Left            =   120
      TabIndex        =   1
      Top             =   720
      Width           =   8295
      _ExtentX        =   14631
      _ExtentY        =   9551
      View            =   3
      LabelEdit       =   1
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      FullRowSelect   =   -1  'True
      _Version        =   393217
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      BorderStyle     =   1
      Appearance      =   1
      NumItems        =   0
   End
   Begin MSCommLib.MSComm MSComm1 
      Left            =   0
      Top             =   5640
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
      DTREnable       =   -1  'True
   End
   Begin VB.PictureBox Toolbar1 
      Align           =   1  'Align Top
      Height          =   615
      Left            =   0
      ScaleHeight     =   555
      ScaleWidth      =   8505
      TabIndex        =   5
      Top             =   0
      Width           =   8565
      Begin VB.CommandButton Command2 
         Height          =   495
         Left            =   520
         Picture         =   "frmComm.frx":0442
         Style           =   1  'Graphical
         TabIndex        =   3
         ToolTipText     =   "通讯设置"
         Top             =   50
         Width           =   495
      End
      Begin VB.CommandButton Command4 
         Default         =   -1  'True
         Height          =   495
         Left            =   1560
         Picture         =   "frmComm.frx":06C4
         Style           =   1  'Graphical
         TabIndex        =   2
         ToolTipText     =   "测试"
         Top             =   50
         Width           =   495
      End
      Begin VB.CommandButton Command3 
         Height          =   495
         Left            =   1040
         Picture         =   "frmComm.frx":0946
         Style           =   1  'Graphical
         TabIndex        =   4
         ToolTipText     =   "配置"
         Top             =   50
         Width           =   495
      End
      Begin VB.CommandButton Command1 
         Height          =   495
         Left            =   0
         Picture         =   "frmComm.frx":0BC8
         Style           =   1  'Graphical
         TabIndex        =   0
         ToolTipText     =   "搜索"
         Top             =   50
         Width           =   495
      End
   End
   Begin VB.Menu File 
      Caption         =   "文件(&F)"
      Begin VB.Menu Save 
         Caption         =   "保存(&S)"
         Enabled         =   0   'False
      End
      Begin VB.Menu Print 
         Caption         =   "打印(&P)"
         Enabled         =   0   'False
      End
      Begin VB.Menu Exit 
         Caption         =   "退出(&x)"
      End
   End
   Begin VB.Menu Network 
      Caption         =   "网络(&N)"
      Begin VB.Menu ComPort 
         Caption         =   "端口(&C)"
      End
      Begin VB.Menu Search 
         Caption         =   "搜索(&S)"
      End
   End
   Begin VB.Menu Operation 
      Caption         =   "操作(&O)"
      Begin VB.Menu Terminal 
         Caption         =   "终端(&T)"
         Enabled         =   0   'False
      End
      Begin VB.Menu Congfiguration 
         Caption         =   "配置(&C)"
      End
      Begin VB.Menu Monitor 
         Caption         =   "监测(&M)"
         Enabled         =   0   'False
      End
      Begin VB.Menu Diagnostic 
         Caption         =   "测试(&D)"
      End
      Begin VB.Menu Calibration 
         Caption         =   "校准(&a)"
         Enabled         =   0   'False
      End
   End
   Begin VB.Menu Help 
      Caption         =   "帮助(&H)"
      Begin VB.Menu Contents 
         Caption         =   "标题(&C)"
      End
      Begin VB.Menu About 
         Caption         =   "联系我们(&A)"
      End
   End
End
Attribute VB_Name = "frmComm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub About_Click()
     frmabout.Show
End Sub

Private Sub Command1_Click()
  frmSearch.Show
End Sub

Private Sub Command2_Click()
  frmProper.Show
End Sub
Private Sub Command3_Click()
   If modindex <> 0 Then
      frmComm.Enabled = False
      frmConfig.Show
   End If
End Sub

Private Sub Command4_Click()
   If modindex <> 0 Then
      frmComm.Enabled = False
      Diagnost.Show
   End If
   
End Sub

Private Sub ComPort_Click()
   frmProper.Show
End Sub

Private Sub Congfiguration_Click()
   If modindex <> 0 Then
      frmComm.Enabled = False
      frmConfig.Show
   End If
End Sub
 
Private Sub Diagnostic_Click()
   If modindex <> 0 Then
      frmComm.Enabled = False
      Diagnost.Show
   End If
   
End Sub

Private Sub Exit_Click()
    End
End Sub

Private Sub Form_Load()
   'Set chListView = ListView1.ColumnHeaders.Add(1, "Filename", "Filename")
   Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
   LV.ColumnHeaders.Add 1, "Address", "Address", LV.Width * 3 / 22
   LV.ColumnHeaders.Add 2, "Model", "Model", LV.Width / 7
   LV.ColumnHeaders.Add 3, "HighLimit", "HighLimit", LV.Width / 7
   LV.ColumnHeaders.Add 4, "LowLimit", "LowLimit", LV.Width / 7
   LV.ColumnHeaders.Add 5, "Format", "Format", LV.Width / 7
   LV.ColumnHeaders.Add 6, "Alarm", "Alarm", LV.Width / 7
   LV.ColumnHeaders.Add 7, "Remark", "Remark", LV.Width / 7
End Sub
 
Private Sub LV_ItemClick(ByVal Item As ListItem)
   modindex = Item.Index
   modAddress = Val(Item.Text)
   modName = Item.ListSubItems(1).Text
   'Label7 = ListView1.ColumnHeaders("Type").SubItemIndex
   'item.ListSubItems(3).Text = "sxs"
End Sub
 
Private Sub Search_Click()
  frmSearch.Show
End Sub

Public Sub xxx()
  LV.ListItems(modindex).Text = Format(modAddress, "000") + "(" + Right("0" + Hex(modAddress), 2) + "H)"
'  LV.ListItems(modindex).ListSubItems(1) = "9000"
End Sub

