最好有个代码
[此贴子已经被作者于2006-12-19 13:26:50编辑过]
对你真无言...
添加两个以上的不同控件..那你写两个以上的代码不就可以了吗?...
晕倒...
Option Explicit
Dim txtDemo As TextBox
Dim WithEvents cmdButton As CommandButton
Private Sub Form_Load()
Set txtDemo = Me.Controls.Add("VB.TextBox", "txtDemo", Form1)
With txtDemo
.Width = 1500
.Left = 0
.Top = 0
.Text = ""
.Visible = True
End With
Set cmdButton = Me.Controls.Add("VB.CommandButton", "cmdButton", Form1)
With cmdButton
.Width = 1000
.Left = txtDemo.Left + txtDemo.Width
.Top = 0
.Caption = "Click"
.Visible = True
End With
End Sub
Private Sub cmdButton_Click()
txtDemo.Text = "you click me"
End Sub
我比较讨厌一些..完全不思考..就来这里问问问的人...这样的人..建议不要学编程..
Option Explicit
Dim txtDemo As TextBox
Dim WithEvents cmdButton As CommandButton
Private Sub Form_Load()
Set txtDemo = Me.Controls.Add("VB.TextBox", "txtDemo", Form1)
With txtDemo
.Width = 1500
.Left = 0
.Top = 0
.Text = ""
.Visible = True
End With
Set cmdButton = Me.Controls.Add("VB.CommandButton", "cmdButton", Form1)
With cmdButton
.Width = 1000
.Left = txtDemo.Left + txtDemo.Width + 500
.Top = 0
.Caption = "Click"
.Visible = True
End With
End Sub
Private Sub cmdButton_Click()
txtDemo.Text = "you click me"
End Sub