.net 试图找出在文本框中按enter键时如何触发事件

.net 试图找出在文本框中按enter键时如何触发事件,.net,f#,textbox,.net,F#,Textbox,我使用的代码是: open System open System.Windows.Forms open System.Drawing let tehform = new Form(Text = "STOP!", Width = 200, Height = 200) let awe = new TextBox(Left = 1, Top = 30, Width = 100) let stuff _ _ = MessageBox.Show(awe.Text) |> ignore let ha

我使用的代码是:

open System
open System.Windows.Forms
open System.Drawing

let tehform = new Form(Text = "STOP!", Width = 200, Height = 200)
let awe = new TextBox(Left = 1, Top = 30, Width = 100)
let stuff _ _ = MessageBox.Show(awe.Text) |> ignore
let handler = new EventHandler(stuff)
let yeah = new Button(Text = "", Left = 20, Top = 60, Width = 80)
yeah.Click.AddHandler(handler)
let ms = new MenuStrip()
let file = new ToolStripDropDownButton("File")
let ddi = file.DropDownItems.Add("Hi")
ddi.Click.AddHandler(handler) |> ignore
ms.Items.Add(file) |> ignore
let dc c = (c :> Control)
tehform.Controls.AddRange([| dc yeah; dc ms; dc awe |])

我想,通过查看库,我可以使用awe.oneter.AddHandler(handler),但这也不起作用。谢谢你的帮助

当文本框获得焦点时,OnEnter启动。使用OnKeyDown事件并检查事件参数的Keys属性


.

当文本框获得焦点时,OneNoter启动。使用OnKeyDown事件并检查事件参数的Keys属性


.

你知道当。。。你把你的形态称为“技术形态”。你知道当。。。你把你的表格叫做“TechForm”。