输入文件名.frm

来自「Visual Basic课程举例1 有很好的例题」· FRM 代码 · 共 57 行

FRM
57
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton CmdExit 
      Caption         =   "退出"
      Height          =   495
      Left            =   2640
      TabIndex        =   1
      Top             =   2280
      Width           =   1575
   End
   Begin VB.CommandButton CmdOpen 
      Caption         =   "打开"
      Height          =   495
      Left            =   480
      TabIndex        =   0
      Top             =   2280
      Width           =   1695
   End
   Begin VB.Label Label1 
      Caption         =   "你输入的文件名为:"
      Height          =   495
      Left            =   600
      TabIndex        =   2
      Top             =   120
      Width           =   2055
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdExit_Click()
    End
End Sub

Private Sub CmdOpen_Click()
    Dim FileName As String
    Dim aa As Integer, bb As Integer
     FileName = InputBox$("请输入文件名:", "打开", , 500, 500)
     If FileName = "" Then
        bb = MsgBox("你没有输入文件名,是否要重新输入?", vbOKCancel, "警告!")
     Else
        'aa = 1
        Label1.Caption = Label1.Caption + FileName
     End If
End Sub

⌨️ 快捷键说明

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