Click here to Skip to main content
15,900,725 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am working on windows forms, in my project i have requirement like when ever user typing emai address in textbox it will appear like link.I already did for url using richtextbox detecturl property. but i dont know how to do for email address.any help?
Posted

private void txtlink_KeyPress(object sender, KeyPressEventArgs e)
{

txtlink.Font = new Font(txtlink.Font, FontStyle.Underline);

txtlink.ForeColor = Color.Blue;
txtlink.Cursor = Cursors.Hand;


}

private void txtlink_MouseClick(object sender, MouseEventArgs e)
{
System.Diagnostics.Process.Start("mailto:"+ txtlink.Text);
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900