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

📄 form2.frm

📁 本人初次开发本系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form2 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "公交车资料"
   ClientHeight    =   6855
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   4215
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Picture         =   "Form2.frx":0000
   ScaleHeight     =   342.75
   ScaleMode       =   2  'Point
   ScaleWidth      =   210.75
   StartUpPosition =   3  '窗口缺省
   Begin VB.Timer Timer1 
      Interval        =   200
      Left            =   0
      Top             =   6480
   End
   Begin VB.TextBox Text1 
      BorderStyle     =   0  'None
      DragIcon        =   "Form2.frx":67E1
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   9120
      ScrollBars      =   2  'Vertical
      TabIndex        =   0
      Text            =   "Text1"
      Top             =   120
      Width           =   60000
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "查看下条信息请先关闭此窗口"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   120
      TabIndex        =   2
      Top             =   6360
      Visible         =   0   'False
      Width           =   4095
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Height          =   5295
      Left            =   480
      TabIndex        =   1
      Top             =   960
      Width           =   2895
   End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim cnn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim a(20), jiehe(10), b, asd

Dim e, f, c, d, tt, bijiao As Integer
Private Declare Function ShellExecute Lib "shell32.dll" Alias _
    "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
    ByVal lpFile As String, ByVal lpParameters As String, _
    ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Private Const SW_SHOW = 5

Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long

Private Type POINTAPI
    X As Long
    Y As Long
    End Type

Dim strcnn, bijiao1, bijiao2 As String

Private Sub Form_Click()
If Timer1.Enabled = True Then
Timer1.Enabled = False
Else
Timer1.Enabled = True
End If
End Sub

Private Sub Form_Load()
Label2.Visible = False
asd = 0
Set cnn = New ADODB.Connection
strcnn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\db1.mdb;Persist Security Info=False"
cnn.Open strcnn
Set rs = New ADODB.Recordset
rs.CursorType = adOpenKeyset
rs.LockType = adLockOptimistic
rs.Open "checi", cnn, , , adCmdTable

zx = Form1.Text2.Text
jiehe(0) = "路公车资料:" + Chr(13) + Chr(10)
rs.MoveFirst

Do While Not rs.EOF

If rs.Fields("车次") = zx Then
    a(0) = rs.Fields("车次")
    a(1) = rs.Fields("类型")
    a(2) = rs.Fields("票价")
    a(3) = rs.Fields("行车路线")
  
    
   
  jiehe(1) = "   车   次:" & a(0) + Chr(13) + Chr(10) + "   类    型:" & a(1) + Chr(13) + Chr(10) + "   票    价:" & a(2) + Chr(13) + Chr(10) + "行车路线:" + Chr(13) + Chr(10) + "   " + a(3)
 Label1.Caption = a(0) + Chr(13) + Chr(10) + jiehe(0) + Chr(13) + Chr(10) + jiehe(1)
 Text1.Text = a(0) + Chr(13) + Chr(10) + jiehe(0) + Chr(13) + Chr(10) + jiehe(1)
b = a(0)
 End If
  rs.MoveNext
  Loop
  
  

End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim p1 As POINTAPI
  GetCursorPos p1
  
  e = p1.X
  c = p1.Y

End Sub

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim p1 As POINTAPI
  GetCursorPos p1
  f = p1.X
  d = p1.Y
  
  Me.Top = Me.Top + (d - c) * 15
  Me.Left = Me.Left + (f - e) * 15

End Sub

Private Sub Label2_Click()
End
End Sub

Private Sub Text1_Click()
If Timer1.Enabled = True Then
Timer1.Enabled = False
Else
Timer1.Enabled = True
End If
End Sub

Private Sub Timer1_Timer()
Text1.Left = Text1.Left - 10
If Text1.Left <= -4020 Then
Timer1.Enabled = False
End If
End Sub

⌨️ 快捷键说明

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