Email field on a WinForm

G

Guest

How do you code a WindowsForm field for an email address, so that when the
user double-clicks in the field, an Outlook email form is generated which is
addressed to the email address in the WinForm?
 
S

Stephen Brooker

gwenda said:
How do you code a WindowsForm field for an email address, so that when the
user double-clicks in the field, an Outlook email form is generated which is
addressed to the email address in the WinForm?

The LinkLabel control should do what you need. Just like a label, but
with support for hyperlinks.
 
K

Kevin Yu [MSFT]

Thanks for Stephen's quick response.

Hi Nina,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you would like to implement a TextBox
which would start a new Outlook mail window when double-clicked. If there
is any misunderstanding, please feel free to let me know.

Stephen has given us a good suggestion to use a LinkLabel. We can also use
Textbox and handle the DoubleClick event. Here is an example:

private void textBox1_DoubleClick(object sender, System.EventArgs e)
{
if(this.textBox1.Text != string.Empty)
System.Diagnostics.Process.Start("mailto:"+this.textBox1.Text);
}

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top