dialog.frm

来自「用于GPS数据采集」· FRM 代码 · 共 101 行

FRM
101
字号
VERSION 5.00
Begin VB.Form Dialog 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "站点名"
   ClientHeight    =   1125
   ClientLeft      =   2760
   ClientTop       =   3750
   ClientWidth     =   3945
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1125
   ScaleWidth      =   3945
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  'CenterOwner
   Begin VB.CommandButton OKButton 
      Caption         =   "确定"
      Height          =   405
      Left            =   2730
      TabIndex        =   2
      Top             =   540
      Width           =   1125
   End
   Begin VB.TextBox txtStationName 
      Height          =   375
      Left            =   750
      TabIndex        =   0
      Top             =   60
      Width           =   2385
   End
   Begin VB.ComboBox cboshangxia 
      Height          =   315
      Left            =   1110
      Style           =   2  'Dropdown List
      TabIndex        =   1
      Top             =   570
      Width           =   1365
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "站点名:"
      Height          =   195
      Left            =   90
      TabIndex        =   4
      Top             =   150
      Width           =   720
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "上下行方向:"
      Height          =   195
      Left            =   90
      TabIndex        =   3
      Top             =   630
      Width           =   1080
   End
End
Attribute VB_Name = "Dialog"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Option Explicit

Private Sub Form_Load()
cboshangxia.AddItem "上行"
cboshangxia.AddItem "下行"
cboshangxia.ListIndex = 1
End Sub

Private Sub OKButton_Click()
Dim filename As String
Dim fs, a
filename = "StationInfo" & ".txt"
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.OpenTextFile(App.Path & "\" & filename, 8, True)
If cboshangxia.ListIndex = 0 Then
    strStationName = "#" & txtStationName.Text & "|"
    strStationName = strStationName & strLng & "|"
    strStationName = strStationName & strLat & "|"
    strStationName = strStationName & "#"
ElseIf cboshangxia.ListIndex = 1 Then
    strStationName = "@" & txtStationName.Text & "|"
    strStationName = strStationName & strLng & "|"
    strStationName = strStationName & strLat & "|"
    strStationName = strStationName & "@"
End If
Form1.txtStationInfo.Text = Form1.txtStationInfo.Text & strStationName & Chr(13) & Chr(10)
a.WriteLine (strStationName)
a.Close
Unload Me
End Sub

Private Sub txtStationName_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
   OKButton_Click
End If
End Sub

⌨️ 快捷键说明

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