VB多页控件问题
发布网友
发布时间:2023-07-19 19:33
我来回答
共1个回答
热心网友
时间:2023-08-06 14:39
正确的:
Dim i As Integer
Dim j As Integer
Private Sub CommandButton2_Click()
For i = 0 To MultiPage1.Count - 1 '遍及数组
MsgBox "MultiPage1.Pages(i).Caption = " & MyTextBox1.Text
Next i
End Sub
Private Sub UserForm_Initialize()
j = 1
Me.MultiPage1.Pages.Add.Caption = 1
Call tianjia
End Sub
Private Sub CommandButton1_Click()
i = i + 1
j = j + 1
Me.MultiPage1.Pages.Add.Caption = j
Call tianjia
End Sub
Public Sub tianjia()
Set MyTextBox1 = MultiPage1.Pag44(i).Controls.Add("Forms.TextBox.1", "TextBox1")
MyTertBox1.Left = 40
MyTextBox1.Top = 17
MyTextBox1.Width = 148
MyTextBox1.Height = 18
End Sub