private void HighlightAllInTimeBox(object sender)
{
TextBox aTextbox;
string temp;
aTextbox = (TextBox)sender;
if (aTextbox.Name.ToString() == "txtMSTime" || aTextbox.Name.ToString() == "txtMFTime"
|| aTextbox.Name.ToString() == "txtTSTime" || aTextbox.Name.ToString() == "txtTFTime"
|| aTextbox.Name.ToString() == "txtWSTime" || aTextbox.Name.ToString() == "txtWFTime"
|| aTextbox.Name.ToString() == "txtTSTime" || aTextbox.Name.ToString() == "txtTFTime"
|| aTextbox.Name.ToString() == "txtFSTime" || aTextbox.Name.ToString() == "txtFFTime"
|| aTextbox.Name.ToString() == "txtSSTime" || aTextbox.Name.ToString() == "txtSFTime"
|| aTextbox.Name.ToString() == "txtSSTime" || aTextbox.Name.ToString() == "txtSFTime")
{
temp = aTextbox.Text.Trim();
if(temp.Length > 0)
{
aTextbox.Select(0, temp.Length);
}
}
}
[code]
by the way, it would have worked without the long if but to make sure other people didnt call it i put it in. hope this helps
Age is a consequence of experience