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

📄 按钮数组调试.frm

📁 研究数组控件的程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   6165
   ClientLeft      =   60
   ClientTop       =   720
   ClientWidth     =   7800
   LinkTopic       =   "Form1"
   ScaleHeight     =   6165
   ScaleWidth      =   7800
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "8"
      Height          =   375
      Index           =   7
      Left            =   6960
      TabIndex        =   8
      Top             =   2760
      Width           =   615
   End
   Begin VB.CommandButton Command1 
      Caption         =   "7"
      Height          =   375
      Index           =   6
      Left            =   6000
      TabIndex        =   7
      Top             =   2760
      Width           =   615
   End
   Begin VB.CommandButton Command1 
      Caption         =   "6"
      Height          =   375
      Index           =   5
      Left            =   5040
      TabIndex        =   6
      Top             =   2760
      Width           =   615
   End
   Begin VB.CommandButton Command1 
      Caption         =   "5"
      Height          =   375
      Index           =   4
      Left            =   4080
      TabIndex        =   5
      Top             =   2760
      Width           =   615
   End
   Begin VB.CommandButton Command1 
      Caption         =   "4"
      Height          =   375
      Index           =   3
      Left            =   3120
      TabIndex        =   4
      Top             =   2760
      Width           =   615
   End
   Begin VB.CommandButton Command1 
      Caption         =   "3"
      Height          =   375
      Index           =   2
      Left            =   2160
      TabIndex        =   3
      Top             =   2760
      Width           =   615
   End
   Begin VB.CommandButton Command1 
      Caption         =   "2"
      Height          =   375
      Index           =   1
      Left            =   1200
      TabIndex        =   2
      Top             =   2760
      Width           =   615
   End
   Begin VB.CommandButton Command1 
      Caption         =   "1"
      Height          =   375
      Index           =   0
      Left            =   240
      TabIndex        =   1
      Top             =   2760
      Width           =   615
   End
   Begin VB.TextBox Text1 
      Height          =   735
      Left            =   2400
      TabIndex        =   0
      Top             =   600
      Width           =   2535
   End
   Begin VB.Menu File 
      Caption         =   "文件"
      Begin VB.Menu New 
         Caption         =   "新建航程"
         Shortcut        =   ^N
      End
      Begin VB.Menu Open 
         Caption         =   "打开航程"
      End
      Begin VB.Menu Cutline1 
         Caption         =   "-"
      End
      Begin VB.Menu Reset 
         Caption         =   "复位航程"
      End
      Begin VB.Menu Cutline2 
         Caption         =   "-"
      End
      Begin VB.Menu Save 
         Caption         =   "保存"
      End
      Begin VB.Menu OtherSave 
         Caption         =   "另存为"
      End
      Begin VB.Menu Cutline3 
         Caption         =   "-"
      End
      Begin VB.Menu Exit 
         Caption         =   "退出"
         Shortcut        =   ^Q
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim cmd(8) As String
Private Sub Command1_Click(Index As Integer)
Dim i As Integer
Dim x As String


If cmd(Index) = "0" Then
    cmd(Index) = 1
    
ElseIf cmd(Index) = "1" Then
    cmd(Index) = 0
End If
For i = 0 To 7
    x = x + cmd(i)
Next i
Text1.Text = x
End Sub

Private Sub Form_Load()
Text1.Text = "9"
For i = 0 To 7
    cmd(i) = "0"
Next i
End Sub
Public Function B2D(ByVal Bin As String) As Long
    Dim i As Long
    For i = 1 To Len(Bin)
        B2D = B2D * 2 + Val(Mid(Bin, i, 1))
    Next i
End Function

⌨️ 快捷键说明

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