About Me

My photo
a Dynamic and Energetic guy.....

Sunday, August 30, 2009

Usefull code samples in C#

// Getting the pressed key
if ((e.KeyCode == System.Windows.Forms.Keys.Enter))
{
// Code for the "Enter" key
}


//Check Other Name that has Mr. & "Spaces"
public static bool IsOtherName(string strOtherName)
{
Regex Pattern = new Regex("[^a-zA-Z\\.\\ ?]");
return !Pattern.IsMatch(strOtherName);
}

// String format for "Money"
String.Format("{0:0,0.00}", objRenewal.policy.dblPremium.ToString())

My Masters