VERSION 5.00
Begin VB.Form frmSearch 
   Caption         =   "搜索"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4005
   Icon            =   "frmSearch.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4005
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Cancel 
      Cancel          =   -1  'True
      Caption         =   "取消"
      Height          =   375
      Left            =   2160
      TabIndex        =   9
      Top             =   2640
      Width           =   855
   End
   Begin VB.CommandButton OK 
      Caption         =   "确定"
      Default         =   -1  'True
      Height          =   375
      Left            =   840
      TabIndex        =   8
      Top             =   2640
      Width           =   855
   End
   Begin VB.TextBox Text1 
      Alignment       =   2  'Center
      BorderStyle     =   0  'None
      Height          =   180
      Left            =   2400
      TabIndex        =   0
      Text            =   "255"
      Top             =   2160
      Width           =   375
   End
   Begin VB.Frame Frame1 
      Height          =   1095
      Left            =   240
      TabIndex        =   1
      Top             =   120
      Width           =   3495
      Begin VB.Label Label1 
         Caption         =   "搜索联网的模块,如果要改变串口和波特率,按取消键返回演示程序窗口，进行重新设置!"
         ForeColor       =   &H00004080&
         Height          =   615
         Left            =   120
         TabIndex        =   2
         Top             =   360
         Width           =   3255
      End
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "搜索地址范围从0到："
      Height          =   180
      Index           =   4
      Left            =   600
      TabIndex        =   7
      Top             =   2160
      Width           =   1710
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "9600"
      ForeColor       =   &H00FF0000&
      Height          =   180
      Index           =   3
      Left            =   1680
      TabIndex        =   6
      Top             =   1800
      Width           =   360
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "COM2"
      ForeColor       =   &H00FF0000&
      Height          =   180
      Index           =   2
      Left            =   1680
      TabIndex        =   5
      Top             =   1440
      Width           =   360
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "波特率："
      Height          =   180
      Index           =   1
      Left            =   720
      TabIndex        =   4
      Top             =   1800
      Width           =   720
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "串  口："
      Height          =   180
      Index           =   0
      Left            =   720
      TabIndex        =   3
      Top             =   1440
      Width           =   720
   End
End
Attribute VB_Name = "frmSearch"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Cancel_Click()
   Unload Me
End Sub

Private Sub Form_Load()
   Dim settings As String, Offset As Integer
   Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
   frmComm.Enabled = False
   settings = frmComm.MSComm1.settings
   If InStr(settings, ".") > 0 Then
      Offset = 2
   Else
      Offset = 0
   End If
   Label2(2) = Format(frmComm.MSComm1.CommPort)
   Label2(3) = Left$(settings, Len(settings) - 6 - Offset)
End Sub

Private Sub Form_Unload(Cancel As Integer)
   frmComm.Enabled = True
End Sub

Private Sub OK_Click()
   sum = Val(Text1)
   Unload Me
   frmComm.LV.ListItems.Clear
   frmSearching.Show
End Sub
