practice7_11.frm

来自「深圳大学的vb上机与教学的课件」· FRM 代码 · 共 94 行

FRM
94
字号
VERSION 5.00
Begin VB.Form Form1 
   AutoRedraw      =   -1  'True
   Caption         =   "Form1"
   ClientHeight    =   1920
   ClientLeft      =   8340
   ClientTop       =   6885
   ClientWidth     =   2235
   LinkTopic       =   "Form1"
   ScaleHeight     =   1920
   ScaleWidth      =   2235
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command2 
      Caption         =   "逆序显示"
      Height          =   495
      Left            =   1200
      TabIndex        =   3
      Top             =   1320
      Width           =   975
   End
   Begin VB.CommandButton Command1 
      Caption         =   "生成界面"
      Height          =   495
      Left            =   120
      TabIndex        =   2
      Top             =   1320
      Width           =   975
   End
   Begin VB.TextBox Text2 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Index           =   0
      Left            =   100
      TabIndex        =   1
      Top             =   720
      Width           =   495
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Index           =   0
      Left            =   100
      TabIndex        =   0
      Top             =   120
      Width           =   495
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim N As Integer
Private Sub Command1_Click()
   N = Val(InputBox(" 请指定文本框的总个数"))
   Form1.Width = N * Text1(0).Width + (N - 1) * 20 + 300
   For i = 1 To N - 1
      X1 = Text1(i - 1).Left
      Y1 = Text1(i - 1).Top
      X2 = Text2(i - 1).Left
      Y2 = Text2(i - 1).Top
      Load Text1(i)
      Load Text2(i)
      Text1(i).Visible = True
      Text2(i).Visible = True
      Text1(i).Left = Text1(i - 1).Left + Text1(i - 1).Width + 20
      Text2(i).Left = Text2(i - 1).Left + Text2(i - 1).Width + 20
      Text1(i).Top = Text1(i - 1).Top
      Text2(i).Top = Text2(i - 1).Top
    Next i
End Sub

Private Sub Command2_Click()
   For i = 0 To N - 1
      Text2(i).Text = Text1(N - i - 1).Text
   Next i
End Sub

⌨️ 快捷键说明

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