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

📄 frmgps_userselect.frm

📁 用VB开发的巡检系统基于MAPINFo用VB开发的巡检系统基于MAPINFo很好的
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form frmGPS_UserSelect 
   BorderStyle     =   4  'Fixed ToolWindow
   Caption         =   "选择使用者编号"
   ClientHeight    =   5970
   ClientLeft      =   45
   ClientTop       =   315
   ClientWidth     =   3195
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5970
   ScaleWidth      =   3195
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command2 
      Caption         =   "取消(&C)"
      Height          =   375
      Left            =   1590
      TabIndex        =   2
      Top             =   5580
      Width           =   1575
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定(&O)"
      Height          =   375
      Left            =   30
      TabIndex        =   1
      Top             =   5580
      Width           =   1545
   End
   Begin MSComctlLib.ListView ListView1 
      Height          =   5565
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   3195
      _ExtentX        =   5636
      _ExtentY        =   9816
      View            =   3
      LabelEdit       =   1
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      FullRowSelect   =   -1  'True
      GridLines       =   -1  'True
      _Version        =   393217
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      BorderStyle     =   1
      Appearance      =   1
      NumItems        =   2
      BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         Text            =   "使用者编号"
         Object.Width           =   2117
      EndProperty
      BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         Alignment       =   2
         SubItemIndex    =   1
         Text            =   "姓名"
         Object.Width           =   2646
      EndProperty
   End
End
Attribute VB_Name = "frmGPS_UserSelect"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public mRow As Integer

Private Sub Command1_Click()
    Dim curUserID As String
    If Me.ListView1.ListItems.Count = 0 Then Exit Sub
    curUserID = Me.ListView1.SelectedItem.Text
    If Len(curUserID) = 0 Then Exit Sub
    frmGPS.ListView1.ListItems(mRow).SubItems(3) = curUserID
    Unload Me
End Sub

Private Sub Command2_Click()
    Unload Me
End Sub

Private Sub Form_Load()
    IniUserID
End Sub

Sub IniUserID()
    Dim Rs As New ADODB.Recordset
    Dim strSql As String
    Dim n As Integer
    Set Rs = Nothing
    strSql = "select UserID,UserName from tbl_User order by UserID"
    Rs.Open strSql, gblCn, adOpenKeyset, adLockOptimistic, adCmdText
    Do Until Rs.EOF
        n = n + 1
        Me.ListView1.ListItems.Add , , Rs("UserID")
        Me.ListView1.ListItems(n).SubItems(1) = Rs("UserName")
        Rs.MoveNext
    Loop
    Rs.Close
End Sub

⌨️ 快捷键说明

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