practice7_9.frm

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

FRM
158
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "矩阵运算"
   ClientHeight    =   2520
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6240
   LinkTopic       =   "Form1"
   ScaleHeight     =   2520
   ScaleWidth      =   6240
   StartUpPosition =   2  '屏幕中心
   Begin VB.PictureBox Picture3 
      Height          =   1335
      Left            =   3840
      ScaleHeight     =   1275
      ScaleWidth      =   2235
      TabIndex        =   6
      Top             =   360
      Width           =   2295
   End
   Begin VB.PictureBox Picture2 
      Height          =   1335
      Left            =   1960
      ScaleHeight     =   1275
      ScaleWidth      =   1515
      TabIndex        =   5
      Top             =   360
      Width           =   1575
   End
   Begin VB.PictureBox Picture1 
      Height          =   1335
      Left            =   240
      ScaleHeight     =   1275
      ScaleWidth      =   1395
      TabIndex        =   4
      Top             =   360
      Width           =   1455
   End
   Begin VB.CommandButton Command4 
      Caption         =   "退出"
      Height          =   375
      Left            =   4080
      TabIndex        =   3
      Top             =   1920
      Width           =   855
   End
   Begin VB.CommandButton Command3 
      Caption         =   "清除"
      Height          =   375
      Left            =   3000
      TabIndex        =   2
      Top             =   1920
      Width           =   855
   End
   Begin VB.CommandButton Command2 
      Caption         =   "求积"
      Height          =   375
      Left            =   1920
      TabIndex        =   1
      Top             =   1920
      Width           =   855
   End
   Begin VB.CommandButton Command1 
      Caption         =   "求和"
      Height          =   375
      Left            =   840
      TabIndex        =   0
      Top             =   1920
      Width           =   855
   End
   Begin VB.Label Label2 
      Caption         =   "="
      Height          =   255
      Left            =   3600
      TabIndex        =   8
      Top             =   840
      Width           =   135
   End
   Begin VB.Label Label1 
      Height          =   135
      Left            =   1740
      TabIndex        =   7
      Top             =   840
      Width           =   135
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim a(1 To 5, 1 To 5), b(1 To 5, 1 To 5), c(1 To 5, 1 To 5)

Private Sub Command1_Click()
  Label1.Caption = "+"
  Picture3.Cls
  For i = 1 To 5
    s1 = " "
    For j = 1 To 5
        c(i, j) = a(i, j) + b(i, j)
        s1 = s1 & Format(c(i, j), "!@@@")
    Next j
    Picture3.Print s1
  Next i
End Sub

Private Sub Command2_Click()
  Label1.Caption = "×"
  Picture3.Cls
  For i = 1 To 5
    s1 = " "
    For j = 1 To 5
      c(i, j) = 0
      For k = 1 To 5
         c(i, j) = c(i, j) + a(i, k) * b(k, j)
      Next k
      s1 = s1 & Format(c(i, j), "!@@@@@")
    Next j
    Picture3.Print s1
  Next i
End Sub
Private Sub Command3_Click()
  Picture1.Cls
  Picture2.Cls
  Picture3.Cls
End Sub

Private Sub Command4_Click()
  End
End Sub

Private Sub Picture1_Click()
  Randomize
  Picture1.Cls
  For i = 1 To 5
    s1 = " "
    For j = 1 To 5
        a(i, j) = Int(Rnd * 9 + 1)
        s1 = s1 & Format(a(i, j), "!@@@")
    Next j
    Picture1.Print s1
  Next i
End Sub

Private Sub Picture2_Click()
  Randomize
  Picture2.Cls
  For i = 1 To 5
    s1 = " "
    For j = 1 To 5
        b(i, j) = Int(Rnd * 9 + 1)
        s1 = s1 & Format(b(i, j), "!@@@")
    Next j
    Picture2.Print s1
  Next i
End Sub

⌨️ 快捷键说明

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