×

C# Tutorial

Basics of .Net

C# Basics

C# Fundamentals

C# Operators

C# Loops

C# Type Conversions

C# Exception Handling

C# String Class

C# Arrays

C# List

C# Stack

C# Queue

C# Collections

C# Character Class

C# Class and Object

C# Namespaces

C# Delegates

C# Constructors

C# Inheritance

C# Operator Overloading

C# Structures

C# File Handling

C# Convert.ToInt32()

C# Int32 (int) Struct

C# DateTime Class

C# Uri Class

C# Database Connectivity

C# Windows

C# Other Topics

C# Q & A

C# Programs

C# Find O/P

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);
}
Advertisement
Advertisement


Comments and Discussions!

Load comments ↻


Advertisement
Advertisement
Advertisement

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