返回列表 上一主題 發帖

[發問] 動態新增控制後怎麼觸發事件

[發問] 動態新增控制後怎麼觸發事件

利用以下程式建立了,3個TextBox
Private Sub CommandButton1_Click()
Dim i,k As Integer
Dim theTextBox  As Control
K=10
For i= 1 to  3
Set theTextBox =ME.Controls.Add("Forms.TextBox.1", "TextBox"&i, True)
With  theTextBox
  .Left = 210
  .Top=K
  K=.Top+.Height+ 18
End with
Next i
Set  theTextBox =Nothing
End sub
後續每個TextBox想要_Change()的事件,並控制每個TextBox只能輸入數字
請問該怎麼寫???

謝謝,就是這樣。感謝大大幫忙

TOP

感謝各位!!終於解決了!!

TOP

        靜思自在 : 看別人不順眼,是自己修養不夠。
返回列表 上一主題