Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2008-06-19
3
Medium Priority
?
241 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 1000 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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

618 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