在2000+VB6调试通过:Dim cmdbutton As CommandButtonPrivate Sub Command1_Click()
Set cmdbutton = Me.Controls.Add("VB.CommandButton", "cmdbutton")
With cmdbutton
.Left = 100
.Top = 100
.Height = 500
.Width = 1000
.Caption = "cmd"
.Visible = True
.ZOrder
End With
End Sub
Set cmdbutton = Me.Controls.Add("VB.CommandButton", "cmdbutton")
With cmdbutton
.Left = 100
.Top = 100
.Height = 500
.Width = 1000
.Caption = "cmd"
.Visible = True
.ZOrder
End With
End Sub
Dim myTextBox As TextBoxPrivate Sub Command1_Click()
Set myTextBox = Me.Controls.Add("VB.TextBox", "txtMine")
With myTextBox
.Left = 100
.Top = 100
.Height = 500
.Width = 1000
.Text = "新生成"
.Visible = True
End With
End Sub
Form1.Controls.Add "VB.TextBox", "Text1", Me
With Form1!text1
.Visible = True
.Width = 2000
.Height = 1000
.Top = 50
.Left = 1500
.Text = "gaoqi"
End With
End Sub
With ttt
.Visible = True
.Left = 10
.Top = 10
.Width = 1000
.Height = 1000
End With
Form1.Controls.Add "VB.TextBox", "Text1", Me
With Form1!text1
.Visible = True
.Width = 2000
.Height = 1000
.Top = 50
.Left = 1500
.Text = "gaoqi"
End With
End Sub
visible=false 在编码时用load textbox(1),load textbox(2)等加其他的控件,不过别忘了设置位置,大小和visible=true
怎么样,可以给分吧,呵呵