Simple concatenate question on how to add an email address vb.net

Simple question for a newbie about concatenates. I have three text boxes on a form. txtboxFirstName.Text  txtboxLastName.Text  txtboxEmailID.Text .  The end result I am looking for is to concatenate the third text box with values from the first two text boxes. I have a very simple piece of code in my txtboxFirstName with the following.

txtboxEmailID.Text = txtboxFirstName.Text + txtboxLastName.Text

The result of this gives me the following output in the txtboxemailID.text:  JaneDoe

So far this works as I need it to. Now what I want to do is at the end of the last name add our email address so the end result I am looking for in the txtboxEmailID.Text is :

JaneDoe@aol.com.

My thought was to add another text box called txtemaildomain and have this on the form load:

txtemaildomain.Text = "@aol.com"

Then simply hide that textbox on my form and do the following: txtboxEmailID.Text = txtboxFirstName.Text + txtboxLastName.Text + txtemaildomain.Text

What is the proper syntax or more efficient way to add the @aol.com address to the end of the last name? Thanks in advance.
DJ PAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NorieVBA ExpertCommented:
Instead of another textbox you could use a constant in the code.
Const strDomain As String = "@aol.com"

Open in new window

You could then use this to get the full email address.
txtboxEmailID.Text = txtboxFirstName.Text + txtboxLastName.Text + strDomain

Open in new window

Another option would be to use My.Settings to save the domain as a property of the application.

One advantage of that would be that it gives you the possibility of allowing the user to change the domain if required.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DJ PAuthor Commented:
Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.