计算机应用 | 古代文学 | 市场营销 | 生命科学 | 交通物流 | 财务管理 | 历史学 | 毕业 | 哲学 | 政治 | 财税 | 经济 | 金融 | 审计 | 法学 | 护理学 | 国际经济与贸易
计算机软件 | 新闻传播 | 电子商务 | 土木工程 | 临床医学 | 旅游管理 | 建筑学 | 文学 | 化学 | 数学 | 物理 | 地理 | 理工 | 生命 | 文化 | 企业管理 | 电子信息工程
计算机网络 | 语言文学 | 信息安全 | 工程力学 | 工商管理 | 经济管理 | 计算机 | 机电 | 材料 | 医学 | 药学 | 会计 | 硕士 | 法律 | MBA
现当代文学 | 英美文学 | 通讯工程 | 网络工程 | 行政管理 | 公共管理 | 自动化 | 艺术 | 音乐 | 舞蹈 | 美术 | 本科 | 教育 | 英语 |

公交车查询系统+vb(一)毕业论文(4)

2013-05-09 18:15
导读:ub Label1_Click() End Sub Private Sub Timer1_Timer() bt = False If Check1.Value = 0 Then Form1.IsBeginS = True Else Form1.IsBeginS = False End If Load Form1 Form1.Show Timer1.Enabled = False End Sub P
ub Label1_Click()

End Sub

Private Sub Timer1_Timer()
bt = False
If Check1.Value = 0 Then
   Form1.IsBeginS = True
Else
   Form1.IsBeginS = False
End If
Load Form1
Form1.Show
Timer1.Enabled = False
End Sub

Private Sub Timer2_Timer()
Timer1.Enabled = True
Timer2.Enabled = False
End Sub

 

 

 

2:主界面设计:

代码设计:
Dim bcbm As Boolean
Dim bcb1 As Boolean
Dim bcbs As Boolean
Dim bcbe As Boolean
Dim tm As Integer
Dim intpart As Integer
Public IsBeginS As Boolean

Public Sub showallstation()
' 以下代码是用来把在数据库的所有不同的车站显示在起始站中
' 其思路是如果在启动界面中,用户选择了更新数据库,则扫描整个数据库,并把不同的车站加到起始站中
' 并把这些车站名存放在一文本框中,以用于下次读取
' 如果用户没有选择更新数据库,则直接从文件中读取车站存放在起始站中
' 这样做的好处是可以大大提高效率,如果每次启动都要重新检索数据库,则要花费大量的时间
If IsBeginS = False Then '用户选择了更新数据库
Dim strm As String
Dim mrc3 As ADODB.Recordset
Set mrc3 = New ADODB.Recordset
 Set mrc3 = Adodc1.Recordset
 mrc3.MoveFirst
 Do While Not mrc3.EOF
  For i = 1 To NC
    strm = Text2(i).Text
     If strm = "" Then
       Exit For
     End If
       For j = 0 To cbs.ListCount
          If cbs.List(j) = Trim(strm) Then
          Exit For
          End If

(科教作文网http://zw.ΝsΕac.cOM编辑)


       Next
       If j > cbs.ListCount Then
          cbs.AddItem Trim(strm)
       End If
   Next
   mrc3.MoveNext
   Loop
   If Mid(App.path, Len(App.path) - 1, 1) <> "\" Then
   Open App.path + "\allstation.dat" For Output As #1
   Else
   Open App.path + "allstation.dat" For Output As #1
   End If
      Print #1, CStr(cbs.ListCount)
   For k = 0 To cbs.ListCount - 1
      Print #1, , cbs.List(k)
   Next
   Close #1
Set mrc3 = Nothing
Else '用户没有选择了更新数据库
  Dim strbs As String
  Dim intnb As Integer
  If Mid(App.path, Len(App.path) - 1, 1) <> "\" Then
   Open App.path + "\allstation.dat" For Input As #1
   Else
   Open App.path + "allstation.dat" For Input As #1
   End If
   Input #1, strbs
   intnb = CInt(Val(strbs))
     
   For k = 0 To intnb - 1
      Input #1, strbs
      cbs.AddItem strbs
   Next
   Close #1
   End If
End Sub

Public Sub showtitle(numt As Integer)
'用于显示列表中的标题
For j = 0 To 2
 If numt = 2 And j = 1 Then
    Exit Sub
 End If
 MSF1(j).Clear
  Dim i As Integer
  With MSF1(j)
  .Rows = 2
    .Cols = NC + 3
    .TextMatrix(0, 1) = "车次"
    For k = 1 To NC + 1 (转载自中国科教评价网www.nseac.com )
    .TextMatrix(0, k + 1) = "站" & CStr(k)
    .ColWidth(k) = 1000
   Next
    .TextMatr

上一篇:VB工资管理系统(一)毕业论文网 下一篇:没有了