Hi,
I am working on an application at the moment. Being new to Windows programming I have encountered a small problem, but I'm sure someone knows the answer.
I have a TextBox on a form and have set a property handler to it (using get and set statements). I also have an event setup which executes as I type within the box. It updates an array variable name from the box, but what I don't want to do is execute the last statement in the code below until the user has hit the "Enter" key (or if the user tabs to the next TextBox). How can I do that?
At the moment, with every character change the user makes, the function FileUtilities.TiplocCSVConstructor( ); function executes which renders some data to a CSV file. The time it takes to do this means that the user input gets slowed down with each and every character they type. The CSV file that I currently have is 149Kb in size and I don't want to write it out with every character pressed, but often enough so that the file gets updated frequently on the hard disk/network drive in a semi-realtime fashion!
Thanks.
//*********************************************************************************
// This is the handler for when the user changes a custom station name
//*********************************************************************************
private void Custom_StationNameBox_TextChanged(object sender, EventArgs e)
{
if (StationCodes.sCustom_StationNames != sCustom_StationNameBox)
{
StationCodes.sCustom_StationNames = sCustom_StationNameBox.ToUpper();
}
//This is the line I want to execute only when the user has hit enter ot tabbed to the next TextBox!!!
FileUtilities.TiplocCSVConstructor();
}