Solved

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

Posted on 2008-06-19
3
239 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

696 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