MasterRacker
New member
I have a situation where I want the F5 key to append a timestamp to the contents of certain textboxes when that textbox has focus. I was expecting this to be fairly simple but...
Here's the keypress event for a box:
Here's the timestamp method:
The surprising behavior is that I get the test string when I press "t", instead of the F5 key. What can possibley cause something like that?
[sub]Jeff
[purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day
I was not born cynical - I earned my cynicism through careful observation of the world around me.[/sub]
Here's the keypress event for a box:
Code:
private void uxNotes_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
uxNotes.Text += Timestamp.F5Append(e);
}
Here's the timestamp method:
Code:
using System;
using System.Windows.Forms;
namespace TI.Lib
{
public class Timestamp
{
public static string F5Append(KeyPressEventArgs e)
{
if ((Keys) e.KeyChar == Keys.F5)
{
return "***test***";
}
else
{
return "";
}
}
}
}
The surprising behavior is that I get the test string when I press "t", instead of the F5 key. What can possibley cause something like that?
[sub]Jeff
[purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day
I was not born cynical - I earned my cynicism through careful observation of the world around me.[/sub]