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!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.