Announcements
Hi,
It is possible to capture when the user click an specific key (enter) in a GP window using visual studio tools?
Thanks,
EV
If you don't want pressing enter to execute the Save button, go to User Preferences and change the Entry Key from Tab to Return.
No need for complex code.
Hi,
Thanks.
I resolve it using this.
private void SaveRecord_ValidateBeforeOriginal(object sender, System.ComponentModel.CancelEventArgs e)
set the KeyDown event on the object you are monitoring to your 'do stuff' event.
private void Enter_Click(object sender, System.Windows.Forms.KeyEventArgs e)
{
try
{
var s = e.KeyValue;
if (s == 13) //13 is the keyvalue for the 'Enter' key
{
OK.PerformClick();
}
}
catch (Exception err)
{
stuff
}
}
André Arnaud de Cal...
294,095
Super User 2025 Season 1
Martin Dráb
232,866
Most Valuable Professional
nmaenpaa
101,158
Moderator