Dim bt As WinForm.Button '定义一个对象 Dim tb As WinForm.TextBox '定义一个对象 bt=e.Sender tb=e.Form.Controls("自动生成") Messagebox.show(bt.Text,"提示",MessageBoxButtons.OK,MessageBoxIcon.Information) Messagebox.show(tb.Value,"提示",MessageBoxButtons.OK,MessageBoxIcon.Information)