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

📄 form1.frm

📁 在开发有关的卢定位的软件时
💻 FRM
字号:
VERSION 5.00
Begin VB.Form form1 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "公交线路模拟"
   ClientHeight    =   3945
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   9060
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3945
   ScaleWidth      =   9060
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  '窗口缺省
   Begin VB.Frame Frame1 
      Caption         =   "请输入该站点的名称"
      Height          =   750
      Left            =   6045
      TabIndex        =   8
      Top             =   3105
      Width           =   2865
      Begin VB.TextBox Text1 
         Height          =   360
         Left            =   300
         TabIndex        =   9
         Top             =   270
         Width           =   2355
      End
   End
   Begin VB.Label Label3 
      Caption         =   "请用鼠标拖动图标的方法修改线路, 单击站点名修改站点名称"
      Height          =   405
      Left            =   105
      TabIndex        =   7
      Top             =   3240
      Width           =   3000
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "长春站"
      Height          =   180
      Index           =   5
      Left            =   8055
      TabIndex        =   6
      Top             =   1725
      Width           =   540
   End
   Begin VB.Image Image1 
      Height          =   495
      Index           =   5
      Left            =   7785
      Picture         =   "form1.frx":0000
      Top             =   1170
      Width           =   1050
   End
   Begin VB.Line Line1 
      BorderColor     =   &H00C00000&
      BorderWidth     =   2
      Index           =   4
      X1              =   7275
      X2              =   7800
      Y1              =   855
      Y2              =   1440
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "一面街"
      Height          =   180
      Index           =   4
      Left            =   6495
      TabIndex        =   5
      Top             =   1200
      Width           =   540
   End
   Begin VB.Image Image1 
      Height          =   495
      Index           =   4
      Left            =   6225
      Picture         =   "form1.frx":4EA5
      Top             =   675
      Width           =   1050
   End
   Begin VB.Line Line1 
      BorderColor     =   &H00C00000&
      BorderWidth     =   2
      Index           =   3
      X1              =   5685
      X2              =   6210
      Y1              =   2085
      Y2              =   900
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "八道街"
      Height          =   180
      Index           =   3
      Left            =   4905
      TabIndex        =   4
      Top             =   2325
      Width           =   540
   End
   Begin VB.Image Image1 
      Height          =   495
      Index           =   3
      Left            =   4635
      Picture         =   "form1.frx":9D4A
      Top             =   1815
      Width           =   1050
   End
   Begin VB.Line Line1 
      BorderColor     =   &H00C00000&
      BorderWidth     =   2
      Index           =   2
      X1              =   4185
      X2              =   4620
      Y1              =   1380
      Y2              =   2025
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "东盛路"
      Height          =   180
      Index           =   2
      Left            =   3375
      TabIndex        =   3
      Top             =   1725
      Width           =   540
   End
   Begin VB.Image Image1 
      Height          =   495
      Index           =   2
      Left            =   3120
      Picture         =   "form1.frx":EBEF
      Top             =   1170
      Width           =   1050
   End
   Begin VB.Line Line1 
      BorderColor     =   &H00C00000&
      BorderWidth     =   2
      Index           =   1
      X1              =   2610
      X2              =   3105
      Y1              =   1620
      Y2              =   1320
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "民丰街"
      Height          =   180
      Index           =   1
      Left            =   1845
      TabIndex        =   2
      Top             =   1905
      Width           =   540
   End
   Begin VB.Image Image1 
      Height          =   495
      Index           =   1
      Left            =   1560
      Picture         =   "form1.frx":13A94
      Top             =   1335
      Width           =   1050
   End
   Begin VB.Label Label2 
      Caption         =   "X路车线路图"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   18
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Left            =   3345
      TabIndex        =   1
      Top             =   240
      Width           =   2385
   End
   Begin VB.Image Image1 
      Height          =   495
      Index           =   0
      Left            =   45
      Picture         =   "form1.frx":18939
      Top             =   1035
      Width           =   1050
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "乐群街"
      Height          =   180
      Index           =   0
      Left            =   270
      TabIndex        =   0
      Top             =   1590
      Width           =   540
   End
   Begin VB.Line Line1 
      BorderColor     =   &H00C00000&
      BorderWidth     =   2
      Index           =   0
      X1              =   1095
      X2              =   1560
      Y1              =   1305
      Y2              =   1635
   End
End
Attribute VB_Name = "form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
 Dim Sign As Boolean
 
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
  Dim x1 As Long
  Dim y1 As Long
  Dim j As Integer
  
Private Type POINTAPI
  X As Long
  Y As Long
End Type

Private Sub Form_Load()
Frame1.Visible = False
End Sub

Private Sub Image1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  j = Index
End Sub

Private Sub Image1_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  Dim n As POINTAPI
  GetCursorPos n
  If j > 0 And j < 5 Then
     Image1(j).Left = n.X * 15 - Me.Left: Image1(j).Top = n.Y * 15 - Me.Top
     Line1(j - 1).x1 = Image1(j - 1).Left + Image1(j - 1).Width
     Line1(j - 1).y1 = Image1(j - 1).Top + Image1(j - 1).Height / 2
     Line1(j - 1).X2 = Image1(j).Left
     Line1(j - 1).Y2 = Image1(j).Top + Image1(j).Height / 2
     Line1(j).x1 = Image1(j).Left + Image1(j).Width
     Line1(j).y1 = Image1(j).Top + Image1(j).Height / 2
     Line1(j).X2 = Image1(j + 1).Left
     Line1(j).Y2 = Image1(j + 1).Top + Image1(j + 1).Height / 2
     Label1(j).Top = Image1(j).Top + Image1(j).Height + 100
     Label1(j).Left = Image1(j).Left + Image1(j).Width / 2
  End If
End Sub

Private Sub Command1_Click()
  End
End Sub

Private Sub Label1_Click(Index As Integer)
If Sign = True Then
   MsgBox "不能同时修改两个站点!", , "信息提示"
   For i = 0 To Label1.UBound
     Label1(i).ForeColor = RGB(0, 0, 0)
   Next i
   Frame1.Visible = False
   Sign = False
   Exit Sub
End If
Select Case Index
Case 0
  Label1(0).ForeColor = RGB(255, 0, 0)
  Frame1.Visible = True
  Text1.SetFocus
  Sign = True
Case 1
  Label1(1).ForeColor = RGB(255, 0, 0)
  Frame1.Visible = True
  Text1.SetFocus
  Sign = True
Case 2
  Label1(2).ForeColor = RGB(255, 0, 0)
  Frame1.Visible = True
  Text1.SetFocus
  Sign = True
Case 3
  Label1(3).ForeColor = RGB(255, 0, 0)
  Frame1.Visible = True
  Text1.SetFocus
  Sign = True
Case 4
  Label1(4).ForeColor = RGB(255, 0, 0)
  Frame1.Visible = True
  Text1.SetFocus
  Sign = True
Case 5
  Label1(5).ForeColor = RGB(255, 0, 0)
  Frame1.Visible = True
  Text1.SetFocus
  Sign = True
End Select
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
   For i = 0 To Label1.UBound
     If Label1(i).ForeColor = RGB(255, 0, 0) Then
         Label1(i).Caption = Text1.Text
         Label1(i).ForeColor = RGB(0, 0, 0)
         Frame1.Visible = False
         Sign = False
     End If
   Next i
End If
End Sub

⌨️ 快捷键说明

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