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

📄 frmfind.ebf

📁 Windows CE 应用程序设计随书源码
💻 EBF
字号:
VERSION 5.00
Begin VB.Form frmFind 
   Appearance      =   0  'Flat
   BackColor       =   &H80000005&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "查找"
   ClientHeight    =   1770
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   2685
   ForeColor       =   &H80000008&
   ScaleHeight     =   1770
   ScaleWidth      =   2685
   Begin VBCE.CommandButton Command2 
      Height          =   255
      Left            =   1560
      TabIndex        =   5
      Top             =   1320
      Width           =   735
      _cx             =   1296
      _cy             =   450
      BackColor       =   12632256
      Caption         =   "关闭"
      Enabled         =   -1  'True
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Style           =   0
   End
   Begin VBCE.CommandButton cmdFind 
      Height          =   255
      Left            =   600
      TabIndex        =   4
      Top             =   1320
      Width           =   735
      _cx             =   1296
      _cy             =   450
      BackColor       =   12632256
      Caption         =   "查找"
      Enabled         =   -1  'True
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Style           =   0
   End
   Begin VBCE.TextBox FindValue 
      Height          =   255
      Left            =   840
      TabIndex        =   3
      Top             =   840
      Width           =   1455
      _cx             =   2566
      _cy             =   450
      BackColor       =   -2147483643
      BorderStyle     =   1
      Enabled         =   -1  'True
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   -2147483640
      Text            =   ""
      Alignment       =   0
      HideSelection   =   -1  'True
      Locked          =   0   'False
      MaxLength       =   0
      MultiLine       =   0   'False
      PasswordChar    =   ""
      ScrollBars      =   0
   End
   Begin VBCE.Label Label2 
      Height          =   180
      Left            =   240
      TabIndex        =   2
      Top             =   840
      Width           =   210
      _cx             =   370
      _cy             =   318
      AutoSize        =   -1  'True
      BackColor       =   -2147483643
      BackStyle       =   1
      BorderStyle     =   0
      Caption         =   "值"
      Enabled         =   -1  'True
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   -2147483640
      Alignment       =   0
      UseMnemonic     =   -1  'True
      WordWrap        =   0   'False
   End
   Begin VBCE.ComboBox FindType 
      Height          =   300
      Left            =   840
      TabIndex        =   1
      Top             =   360
      Width           =   1455
      List            =   "frmFind.frx":0000
      ItemData        =   "frmFind.frx":0028
      _cx             =   2566
      _cy             =   529
      BackColor       =   -2147483643
      Enabled         =   -1  'True
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   -2147483640
      Text            =   ""
      IntegralHeight  =   -1  'True
      Locked          =   0   'False
      Sorted          =   0   'False
      Style           =   0
   End
   Begin VBCE.Label Label1 
      Height          =   180
      Left            =   240
      TabIndex        =   0
      Top             =   360
      Width           =   390
      _cx             =   688
      _cy             =   318
      AutoSize        =   -1  'True
      BackColor       =   -2147483643
      BackStyle       =   1
      BorderStyle     =   0
      Caption         =   "查找"
      Enabled         =   -1  'True
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   -2147483640
      Alignment       =   0
      UseMnemonic     =   -1  'True
      WordWrap        =   0   'False
   End
End
Attribute VB_Name = "frmFind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdFind_Click()
On Error Resume Next
Dim conn As ADOCE.Connection
Set conn = CreateObject("ADOCE.connection.3.1")
conn.ConnectionString = frmMain.dbConnStr
conn.Open
Dim sql As String
Select Case FindType.Text
Case "项目名称"
sql = "select * from MsgInfo where MsgName like '%" & FindValue.Text & "%'"
Case "项目负责人"
sql = "select * from MsgInfo where MsgAuthor like '%" & FindValue.Text & "%'"
Case "项目日期"
sql = "select * from MsgInfo where MsgDate like '%" & FindValue.Text & "%'"
End Select
Dim mitem As ListItem
Dim myRec As ADOCE.Recordset
Set myRec = CreateObject("ADOCE.recordset.3.1")
myRec.Open sql, conn, adOpenStatic
frmMain.MsgInfoList.ListItems.Clear
Do While Not myRec.EOF
    Set mitem = frmMain.MsgInfoList.ListItems.Add(, "t" & myRec("msgID"), myRec("msgID"))
    mitem.SubItems(1) = Trim(myRec("MsgName"))
    mitem.SubItems(2) = Trim(myRec("MsgAuthor"))
    mitem.SubItems(3) = Trim(myRec("MsgDate"))
    mitem.SubItems(4) = Trim(myRec("MsgDetail"))
myRec.MoveNext
Loop
myRec.Close
Set myRec = Nothing
conn.Close
Set conn = Nothing
Me.Hide
End Sub

Private Sub Command2_Click()
Me.Hide
End Sub

Private Sub Form_Load()
FindType.AddItem "项目名称"
FindType.AddItem "项目负责人"
FindType.AddItem "项目日期"
FindType.ListIndex = 1
End Sub

⌨️ 快捷键说明

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