我正在尝试创建一个文本编写程序,当我创建一个新页面时,我想为该文本框创建一个新的子文档。这就是我想要做的。
Sub textBox1KeyDown(sender As Object, e As EventArgs)
makeChanged() ' makeChanged() is just a sub to change something in the tab title.
End Sub
无论如何都要将该子添加到由代码生成的文本框中:
Dim p As New TextBox 'Is there any way to add that sub onto this?
答案 0 :(得分:0)
您需要做的是为KeyDown
事件添加处理程序,如下所示:
Dim p As New TextBox
AddHandler p.KeyDown, Sub(sn As Object, args As KeyEventArgs) makeChanged()