问题
I have simple ListView with 3-4 columns. One of the columns have an email address. I would like to be able to press that email address and open up any program which is associated with emails (most likely Outlook).
Is there a way to achieve that without external ListView?
回答1:
Try this
private void listView1_MouseClick(object sender, MouseEventArgs e)
{
try {
string mailtoLink = "mailto:"+listView1.SelectedItems[0].SubItems[email_Column].Text;
System.Diagnostics.Process.Start(mailtoLink);
} catch(Win32Exception ex) {
MessageBox.Show("An error has occured: "+ ex.Message);
}
}
The email is of the format: user@domain.com
来源:https://stackoverflow.com/questions/5103133/how-to-use-hyperlink-inside-listview-in-winforms-c-sharp