Home » .Net » C#.Net » C#.Net Windows Development

Design an Application to display text of TextBox in MessageBox on button click event in C#

In this article, we are designing a form, in which we will display text that is input in the TextBox in the MessageBox using Button Click Event in C#.
Submitted by IncludeHelp, on September 10, 2018

Here, we took two controls on windows form that are TextBox and Button, named txtInput and btnShow respectively. We have to write C# code to display TextBox’s text in the MessageBox on Button Click.

Example:

C# | Display TextBox text in the MessageBox

In the above application, we wrote code on button click event to show text in MessageBox entered in TextBox.

private void btnShow_Click(object sender, EventArgs e)
{
	MessageBox.Show(textInput.Text);
}




Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.



Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.