Open In App

How to set the Name of the Button in C#?

A Button is an essential part of an application, or software, or webpage. It allows the user to interact with the application or software. In Button, you are allowed to set the name of your button by using Name property. You can use this property in two different methods:

1. Design-Time: It is the easiest method to set the name of the button using the following steps:



Run-Time: It is a little bit trickier than the above method. In this method, you can set the Name property of the Button programmatically with the help of given syntax:



public string Name { get; set; }

Here, the string is used to represent the name of the button. Following steps are used to set the Name property of the Button:


Article Tags :
C#