【发布时间】:2016-01-14 18:37:10
【问题描述】:
我目前在 WPF 中有一个基本的单击按钮,用户可以按下它来搜索我想添加一个 keydown 事件。使用标准 VB 时,我可以 只需实现一个 e.keycode,但因为我使用的是 WPF,所以它似乎有所不同。我在下面包含了我的基本点击功能,有人可以添加它以便它也接受回车键吗?
Private Sub BTNSearch_Click(sender As Object, e As EventArgs) Handles BTNSearch.Click
Dim latitude As Double = Double.Parse(TXTLat.Text.Substring(0, TXTLat.Text.IndexOf(","c)))
Dim longitude As Double = Double.Parse(TXTLong.Text.Substring(TXTLong.Text.IndexOf(","c) + 1))
Dim location = New Microsoft.Maps.MapControl.WPF.Location(latitude, longitude)
Dim Pin = New Microsoft.Maps.MapControl.WPF.Pushpin()
BingMap.Children.Add(Pin)
Pin.Location = location
BingMap.Center = location
BingMap.ZoomLevel = "18"
End Sub
【问题讨论】: