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

📄 form1.frm

📁 gps全球卫星定位VB源码(部分)请自行准备设备接口
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "车辆列表"
   ClientHeight    =   3300
   ClientLeft      =   1500
   ClientTop       =   2010
   ClientWidth     =   6375
   Icon            =   "Form1.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3300
   ScaleWidth      =   6375
   ShowInTaskbar   =   0   'False
   Begin VB.ListBox List1 
      Height          =   3300
      ItemData        =   "Form1.frx":030A
      Left            =   0
      List            =   "Form1.frx":030C
      TabIndex        =   0
      Top             =   0
      Width           =   6375
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private StrInfo1 As String

Private Sub Form_Load()
Dim filename As String
Dim filenum As Integer
Dim textline As String
Dim ddd As String
On Error Resume Next
ddd = Dir("c:\1.tmp")
If ddd <> "" Then
filenum = FreeFile
filename = "c:\1.tmp"
Open filename For Input As filenum
Do While Not EOF(filenum)
    Line Input #filenum, textline
    If Trim(textline) <> "" Then
        List1.AddItem textline
    End If
Loop
Close #filenum
Kill ("c:\1.tmp")
End If
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim filename As String
Dim filenum As Integer
Dim i As Integer
On Error Resume Next
filenum = FreeFile
filename = "c:\1.tmp"
For i = 0 To List1.ListCount
Open filename For Append As #filenum
     'If List1.List(i) <> "" Then
        Print #filenum, List1.List(i)
     'End If
Close #filenum
Next
End Sub

Private Sub List1_Click()
Dim KjID As String
Dim dbs As Database
Dim rst As Recordset
KjID = Trim(Mid(List1.Text, 1, 5))
Set dbs = DBEngine.Workspaces(0).OpenDatabase(strPath + PATH_DBDATA)
Set rst = dbs.OpenRecordset("target")
rst.Index = "CarID"
rst.Seek "=", KjID
If Not rst.NoMatch Then
    StrInfo1 = "用户名" + rst.Fields("Owner") + "   " + "用户手机号" + rst.Fields("CommID") + "   " + "用户电话" + rst.Fields("Tel")
Else
    StrInfo1 = ""
End If
'xx = xxx
'yy = yyy
If List1.ListIndex = -1 Then
    StrInfo1 = ""
End If
List1.ToolTipText = StrInfo1
End Sub

'Private Sub List1_DblClick()
'Dim KjID As String
'    KjID = Trim(Mid(List1.Text, 1, 5))
'    If Not frmTarget.FindByName(KjID) Then Exit Sub
'    frmTarget.Show 1
'End Sub

Private Sub List1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 46 Then
   If List1.ListIndex = -1 Then
      MsgBox "请重新选择", vbCritical, App.title
      Exit Sub
   End If
   List1.RemoveItem List1.ListIndex
End If
End Sub

⌨️ 快捷键说明

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