E-mail format

  • Thread starter Thread starter touf
  • Start date Start date
T

touf

Hi,
I've a textbox bound to a field that contains an email address,
I like to give it an email address format , so it will be highlighted and
the user can click on it to open Outlook.
How is it possible in VB.net.

Thanks.
 
Use a linklabel control, see your toolbar . . .


--
Regards - One Handed Man

Author : Fish .NET & Keep .NET
=========================================
This posting is provided "AS IS" with no warranties,
and confers no rights.
 
I've a textbox bound to a field that contains an email address,
I like to give it an email address format , so it will be highlighted and
the user can click on it to open Outlook.
How is it possible in VB.net.

Hi there,

I have done this quite a few times, it's very easy to do, make a link
label as Armin suggests and put this code in the click event,

Call System.Diagnostics.Process.Start(mailto:[email protected])

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
 
Erm. . . When did I become Armin ???

Woops again, sorry I had just replied to one of Armin's posts and currently
my OE listview columns are so wide I can only see the Subject column. That
was from all of these long posts, sorry, no offence meant of course ;-)

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
 
Thanks firends,
but I need a textBox not a label, I mean that the user has to enter the
value (theb email addresses of the customers)
In another place the email is inside a datagrid.

Any help please.
 
Well place the code inside of a button then maybe? The code

Call System.Diagnostics.Process.Start(mailto:[email protected])

Simply shows how to launch the default MAPI email client with the specified
email address in the title. Where you implement this is up to you, choices
choices :-)

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
 
Thanks.
Nak said:
Well place the code inside of a button then maybe? The code

Call System.Diagnostics.Process.Start(mailto:[email protected])

Simply shows how to launch the default MAPI email client with the specified
email address in the title. Where you implement this is up to you, choices
choices :-)

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
 
Well, I suppose you could get down and dirty and subclass a text box to
print a 'linklabel' inside itself if the text is formatted as an email. Or,
override the paint events to draw it yourself.

But, I would really go with the button to the side of the text box as a
cleaner solution. For instance, clicking on the email address launches
Outlook, then what happens if they mistyped and want to modify the middle of
the email address, clicking in the middle would always launch Outlook.

touf said:
Thanks.
Nak said:
Well place the code inside of a button then maybe? The code

Call System.Diagnostics.Process.Start(mailto:[email protected])

Simply shows how to launch the default MAPI email client with the specified
email address in the title. Where you implement this is up to you, choices
choices :-)

Nick.
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
 
Back
Top