4-14.frm
来自「vb编程+从基础到实践光盘代码」· FRM 代码 · 共 45 行
FRM
45 行
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3090
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 1215
Left = 720
TabIndex = 0
Top = 960
Width = 3015
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Function Search1(a() As Integer, b As Integer) As Integer
Dim int1 As Integer
For int1 = LBound(a) To UBound(a)
If a(int1) = b Then
Search1 = int1
Exit Function
End If
Next
End Function
Private Sub Command1_Click()
Dim num(3) As Integer
num(0) = 0
num(1) = 1
num(2) = 2
num(3) = 3
Print Search1(num(), 2)
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?