2个回答
展开全部
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.TextBox Text1
Height = 495
Left = 1080
TabIndex = 3
Text = "Text1"
Top = 2280
Width = 2175
End
Begin VB.OptionButton Option1
Caption = "Option1"
Height = 375
Index = 2
Left = 1440
TabIndex = 2
Top = 1560
Width = 1335
End
Begin VB.OptionButton Option1
Caption = "Option1"
Height = 375
Index = 1
Left = 1440
TabIndex = 1
Top = 1080
Width = 1335
End
Begin VB.OptionButton Option1
Caption = "Option1"
Height = 375
Index = 0
Left = 1440
TabIndex = 0
Top = 480
Width = 1335
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
For i = 1 To 3
Option1(i - 1).Caption = "测试" & i
Next
End Sub
Private Sub Option1_Click(Index As Integer)
Text1.Text = Option1(Index).Caption
End Sub
将上面文本 保存到记事本,另存为 test.frm 文件
======================================
或者
dim a(1 to 3)
Private Sub Form_Load()
For i = 1 To 3
a(i) = "测试" & i
Next
End Sub
Private Sub Option1_Click(Index As Integer)
Text1.Text =a(i-1)
End Sub
再或者
Private Sub Option1_Click(Index As Integer)
Text1.Text =choose(index+1,"测试1","测试2","测试3")
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询