Solved

How do you display the data you entered in a Textbox to a MessageBox in C#?

Posted on 2008-06-19
3
225 Views
Last Modified: 2013-12-16
I've declared the variable "singleEntry" below as a TextBox. Not sure I've I should have declared the variable type as String. None the less, I want to display the data you enter in a Textbox to a MessageBox in C#?
Most grateful,
WD
TextBox singleEntry = textBoxSingle.Text;

Open in new window

0
Comment
Question by:wally_davis
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
YourReference earned 250 total points
ID: 21827203
System.Windows.Forms.MessageBox.Show(singleEntry);
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 21827214
it should be like:

System.Windows.Forms.MessageBox.Show(yourTextBox.Text);
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 21827219
notice TextBox is a control class, not a string, if you want to use the string inside the control, you have to use the .Text property
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now