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

📄 busmanage.frm

📁 城市公交系统的应用开发
💻 FRM
📖 第 1 页 / 共 2 页
字号:
                    BusHScroll1.Value = BusHScroll1.Max * (bussite(i - 1, 1) / BusImage1.Width)
                    BusImage1.Top = -BusVScroll1.Max * (bussite(i - 1, 2) / BusImage1.Height)
                    BusVScroll1.Value = BusVScroll1.Max * (bussite(i - 1, 2) / BusImage1.Height)
                    BusImage1.Cls
                    BusTxt6.Text = bussite(n - 1, 0)
                    BusTxt6.SelStart = 0
                    BusTxt6.SelLength = Len(BusTxt6.Text)
                    BusTxt6.SetFocus
                    BusImage1.CurrentX = bussite(n - 1, 1)
                    BusImage1.CurrentY = bussite(n - 1, 2)
                    BusImage1.FontBold = True
                    BusImage1.ForeColor = sitecolor
                    BusImage1.FontSize = 10
                    BusImage1.Print bussite(n - 1, 0)
                    BusImage1.Circle (bussite(n - 1, 1), bussite(n - 1, 2)), 50, linecolor
                End If
            End If
        ElseIf BusOption9.Value = True Then
            If BusOption6.Value = True Then
                If BusList2.Selected(i) And i = 1 Then
                    BusManageTimer1.Enabled = False
                    Call addbussiteline       '添加站点信息
                ElseIf BusList2.Selected(i) And i > 1 Then
                    BusLabel11.Caption = "请更改您选中的公交站点名并直接回车"
                    n = i - 1
                    BusImage1.Left = -BusHScroll1.Max * (bussite(n - 1, 1) / BusImage1.Width)
                    BusHScroll1.Value = BusHScroll1.Max * (bussite(n - 1, 1) / BusImage1.Width)
                    BusImage1.Top = -BusVScroll1.Max * (bussite(n - 1, 2) / BusImage1.Height)
                    BusVScroll1.Value = BusVScroll1.Max * (bussite(n - 1, 2) / BusImage1.Height)
                    BusImage1.Cls
                    siterad = 5
                    BusManageTimer1.Enabled = True
'                    BusTxt6.Text = bussite(n - 1, 0)
'                    BusTxt6.SelStart = 0
'                    BusTxt6.SelLength = Len(BusTxt6.Text)
'                    BusTxt6.SetFocus
'                    BusImage1.CurrentX = bussite(n - 1, 1)
'                    BusImage1.CurrentY = bussite(n - 1, 2)
'                    BusImage1.FontBold = True
'                    BusImage1.ForeColor = sitecolor
'                    BusImage1.FontSize = 10
'                    BusImage1.Print bussite(n - 1, 0)
'                    BusImage1.Circle (bussite(n - 1, 1), bussite(n - 1, 2)), 50, linecolor
                End If
            ElseIf BusOption7.Value = True Then
                'Call addbusline              '添加公交线路
            End If
        End If
    Next
End Sub

Private Sub BusManageTimer1_Timer()
'站点较果图
'=================================================================================================================
    If siterad > 80 Then
        siterad = 5
    End If
    BusImage1.Cls
    BusImage1.CurrentX = bussite(n - 1, 1)
    BusImage1.CurrentY = bussite(n - 1, 2)
    BusImage1.FontBold = True
    BusImage1.ForeColor = sitecolor
    BusImage1.FontSize = 10
    BusImage1.Print bussite(n - 1, 0)
    BusImage1.Circle (bussite(n - 1, 1), bussite(n - 1, 2)), siterad, linecolor
    siterad = siterad + 5
End Sub

Private Sub BusOption6_Click() '站点信息查询
    BusFrame5.Caption = BusOption6.Caption
    Call Busmanageclear
End Sub

Private Sub BusOption7_Click() '公交线路查询
    BusFrame5.Caption = BusOption7.Caption
    Call Busmanageclear
End Sub

Private Sub BusOption8_Click()
    BusLabel11.Caption = "请更改您选中的公交站点名并直接回车"
    Call Busmanageclear
End Sub

Private Sub BusOption9_Click()
    n = 1
    t = 1
    x1 = -1
    y1 = -1
    BusList2.Clear
    'BusLabel11.Caption = "请输入公交站点名并直接回车以便添加到以下列表框然后在地图中点击其坐标"
    Call Busmanageclear
End Sub

Private Sub BusTxt3_KeyPress(KeyAscii As Integer) '快捷键
    If KeyAscii = 13 Then
        If BusTxt3 <> "" Then
            If BusOption6.Value = True Then
                If BusOption8.Value = True Then
                    Call managebussite
                ElseIf BusOption9.Value = True Then
                    'BusList2.AddItem "第" & Trim(BusTxt3.Text) & "公交车站点:", 0
                    'BusTxt4.SetFocus
                    Call managebussite
                End If
            ElseIf BusOption7.Value = True Then
                If BusOption8.Value = True Then
                    Call managebussite
                ElseIf BusOption9.Value = True Then
                    BusList2.Clear
                    BusList2.AddItem "第" & Trim(BusTxt3.Text) & "公交车站点:", 0
                    BusTxt4.SetFocus
                End If
            End If
        Else
            MsgBox "请输入公交线路名", 48, "提示信息"
        End If
    End If
End Sub

Private Sub BusTxt4_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        If BusTxt4 <> "" Then
            If BusOption8.Value = True Then
                Call editBussite
            ElseIf BusOption9.Value = True Then
                BusList2.AddItem "始    点:" & Trim(BusTxt4.Text), 1
                n = n + 1
                BusTxt5.SetFocus
            End If
        Else
            MsgBox "请输入公交始点名", 48, "提示信息"
        End If
    End If
End Sub

Private Sub BusTxt5_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        If BusTxt5 <> "" Then
            If BusOption8.Value = True Then
                Call editBussite
            ElseIf BusOption9.Value = True Then
                BusList2.AddItem "终    点:" & Trim(BusTxt5.Text)
                BusTxt6.SetFocus
            End If
        Else
            MsgBox "请输入公交终点名", 48, "提示信息"
        End If
    End If
End Sub

Private Sub BusTxt6_KeyPress(KeyAscii As Integer) '快捷键
    If KeyAscii = 13 Then
        If BusTxt6 <> "" Then
            If BusOption6.Value = True Then
                If BusOption8.Value = True Then
                    bussite(n - 1, 0) = Trim(BusTxt6.Text)
                    Busmanage.BusList2.Clear
                    Busmanage.BusList2.AddItem "请点击列表框项查看相关信息"
                    Busmanage.BusList2.AddItem "经过" & Busmanage.BusTxt3.Text & "公交车的站点有:"
                    For i = 0 To z - 1
                        If i = 0 Then
                            Busmanage.BusList2.AddItem "始    点:" & bussite(i, 0)
                        ElseIf i = z - 1 Then
                            Busmanage.BusList2.AddItem "终    点:" & bussite(i, 0)
                        ElseIf i < 9 Then
                            BusList2.AddItem "第0" & (i + 1) & "站点:" & bussite(i, 0)
                        Else
                            BusList2.AddItem "第0" & (i + 1) & "站点:" & bussite(i, 0)
                        End If
                    Next
                ElseIf BusOption9.Value = True Then
                End If
            ElseIf BusOption7.Value = True Then
                If BusOption8.Value = True Then
                    Call editBussite
                ElseIf BusOption9.Value = True Then
                    If n < 10 Then
                        SiteName = BusList2.List(BusList2.ListCount - 1)
                        BusList2.AddItem "第0" & n & "站点:" & Trim(BusTxt6.Text), BusList2.ListCount - 1
                        n = n + 1
                    Else
                        SiteName = BusList2.List(BusList2.ListCount - 1)
                        BusList2.AddItem "第" & n & "站点:" & Trim(BusTxt6.Text), BusList2.ListCount - 1
                        n = n + 1
                    End If
                End If
            End If
        Else
            MsgBox "请输入公交站点名", 48, "提示信息"
        End If
    End If
End Sub

Private Sub Form_Load() '初始化加载
    BusManageTimer1.Interval = 100
    BusManageTimer1.Enabled = False
    selectfind = False
    BusLabel11.Caption = "请在公交线路文本框中输入公交线路并直接回车"
    BusLabel12.Caption = "(0,0)"
    BusFrame5.Caption = BusOption6.Caption
    Call Form_Resize
End Sub

Private Sub Form_Resize() '初始化窗口

'加载图片
'=================================================================================================================
    Busmanage.Icon = LoadPicture(App.Path + "\picture\icon.ico")
    'BusSelect.Picture = LoadPicture(App.Path + "\picture\adminback.jpg")
    BusImage1.Picture = LoadPicture(App.Path + "\picture\fuzhou.jpg")
'=================================================================================================================

'滚动条字符
'=================================================================================================================
    BusLabel5.Left = 0
    BusLabel5.Top = 60
    BusManageTimer.Interval = 100
    BusManageTimer.Enabled = True
'=================================================================================================================

    'If BusFrame3.Top > Busmanage.Height Then
    
'智能查询框
'=================================================================================================================
        BusFrame4.Left = 50
        BusFrame4.Top = BusLabel5.Top + BusLabel5.Height + 100
        BusFrame5.Left = 50
        BusFrame5.Top = BusFrame4.Top + BusFrame4.Height + 50
        BusLabel6.Top = BusFrame4.Top
        BusLabel12.Top = BusLabel6.Top
        BusFrame6.Left = 50
        BusFrame6.Top = BusFrame5.Top + BusFrame5.Height + 100
        BusFrame6.Height = Busmanage.Height - (BusFrame5.Top + BusFrame5.Height) - BusCmd3.Height - 900
        BusList2.Height = BusFrame6.Height - 350
        BusCmd3.Top = BusFrame6.Top + BusFrame6.Height + 100
        BusCmd4.Top = BusCmd3.Top
'=================================================================================================================
    
'效果图
'=================================================================================================================
        BusPicture1.Left = BusLabel6.Left
        BusPicture1.Top = BusLabel6.Top + BusLabel6.Height + 100
        BusPicture1.Height = Busmanage.Height - (BusLabel6.Top + BusLabel6.Height) - 1055
        BusPicture1.Width = Busmanage.Width - BusPicture1.Left - 455
        x1 = -1
        y1 = -1
        BusImage1.DrawWidth = 3
        BusImage1.AutoRedraw = True
        BusImage1.Left = 0
        BusImage1.Top = 0
'=================================================================================================================
    
'垂直滚动条
'=================================================================================================================
        BusVScroll1.Left = BusPicture1.Left + BusPicture1.Width
        BusVScroll1.Top = BusPicture1.Top
        BusVScroll1.Width = 255
        BusVScroll1.Height = BusPicture1.Height + 255
        BusVScroll1.SmallChange = 100
        BusVScroll1.LargeChange = 500
        BusVScroll1.min = 0
'=================================================================================================================
    
'水平滚动条
'=================================================================================================================
        BusHScroll1.Height = 255
        BusHScroll1.Width = BusPicture1.Width
        BusHScroll1.Left = BusPicture1.Left
        BusHScroll1.Top = BusPicture1.Top + BusPicture1.Height
        BusHScroll1.SmallChange = 100
        BusHScroll1.LargeChange = 500
        BusHScroll1.min = 0
'=================================================================================================================

'设置水平滚动条的最大值
'=================================================================================================================
    'End If
    If BusImage1.Width > BusPicture1.Width Then
        BusHScroll1.Max = BusImage1.Width - BusPicture1.Width
    End If
    
'设置垂直滚动条的最大值
'=================================================================================================================
    If BusImage1.Height > BusPicture1.Height Then
        BusVScroll1.Max = BusImage1.Height - BusPicture1.Height
    End If
End Sub

Private Sub BusHScroll1_Change() '水平滚动条事件
    BusImage1.Left = -BusHScroll1.Value
End Sub

Private Sub BusImage1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) '获得X,Y轴坐标值
    If Button = 1 Then
        If BusOption6.Value = True Then
            If BusOption8.Value = True Then
            ElseIf BusOption9.Value = True Then
            End If
        ElseIf BusOption7.Value = True Then
            If BusOption8.Value = True Then
            ElseIf BusOption9.Value = True Then
                ReDim bussite(t, 3)
                If x1 <> -1 And y1 <> -1 Then
                    BusImage1.Line (x1, y1)-(X, Y), linecolor
                    If t = 1 Then
                        bussite(t, 0) = Trim(BusTxt4.Text)
                        BusTxt5.SelStart = 0
                        BusTxt5.SelLength = Len(BusTxt6.Text)
                        BusTxt5.SetFocus
                    ElseIf t = 2 Then
                        bussite(t, 0) = Trim(BusTxt5.Text)
                        BusTxt6.SelStart = 0
                        BusTxt6.SelLength = Len(BusTxt6.Text)
                        BusTxt6.SetFocus
                    Else
                        bussite(t, 0) = Trim(BusTxt6.Text)
                        BusTxt6.SelStart = 0
                        BusTxt6.SelLength = Len(BusTxt6.Text)
                        BusTxt6.SetFocus
                    End If
                    bussite(t, 1) = X
                    bussite(t, 2) = Y
                    BusTxt6.Text = ""
                    t = t + 1
                Else
                    BusImage1.Circle (X, Y), 50, linecolor
                    If t = 1 Then
                        bussite(t, 0) = Trim(BusTxt4.Text)
                        BusTxt5.SelStart = 0
                        BusTxt5.SelLength = Len(BusTxt6.Text)
                        BusTxt5.SetFocus
                    ElseIf t = 2 Then
                        bussite(t, 0) = Trim(BusTxt5.Text)
                    BusTxt6.SelStart = 0
                        BusTxt6.SelLength = Len(BusTxt6.Text)
                        BusTxt6.SetFocus
                    Else
                        bussite(t, 0) = Trim(BusTxt6.Text)
                        BusTxt6.SelStart = 0
                        BusTxt6.SelLength = Len(BusTxt6.Text)
                        BusTxt6.SetFocus
                    End If
                    bussite(t, 1) = X
                    bussite(t, 2) = Y
                    t = t + 1
                End If
            End If
        End If
        x1 = X
        y1 = Y
    End If
    If Button = 1 Then
        x1 = X
        y1 = Y
    End If
End Sub

Private Sub BusVScroll1_Change() '垂直滚动条事件
    BusImage1.Top = -BusVScroll1.Value
End Sub

Private Sub BusManageTimer_Timer() '控制滚动字符的位置
    BusLabel5.Left = BusLabel5.Left - 100
    If BusLabel5.Left < -BusLabel5.Width Then
        BusLabel5.Left = Busmanage.Width
    End If
End Sub

Private Sub Busmanageclear() '清空文本框
    BusTxt3.Text = ""
    BusTxt3.SetFocus
    BusTxt4.Text = ""
    BusTxt5.Text = ""
    BusTxt6.Text = ""
    BusList2.Clear
    BusManageTimer1.Enabled = False
End Sub

Private Sub editBussite() '更改公交站点名
    For i = 2 To BusList2.ListCount - 1
        If i = n Then
            If i <= 10 Then
                If i = 2 Then
                    BusList2.List(i) = "始    点:" & BusTxt6.Text
                Else
                    BusList2.List(i) = "第0" & i - 1 & "站点:" & BusTxt6.Text
                End If
                bussite(i - 1, 0) = Trim(BusTxt6.Text)
            Else
                If i = BusList2.ListCount Then
                    BusList2.List(i) = "终    点:" & BusTxt6.Text
                Else
                    BusList2.List(i) = "第" & i - 1 & "站点:" & BusTxt6.Text
                End If
                bussite(i - 1, 0) = Trim(BusTxt6.Text)
            End If
        End If
    Next
End Sub

⌨️ 快捷键说明

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