Adding Button Programmatically Using C#



In this tutorial I will teach you how to add a Button programmatically in C#.Net. With this method, there’s no need for you to drag and drop a Button in the Form anymore because the button will automatically appear on the Form . New Buttons will be added in the Form when clicked.



So, let’s get stated:



Open Microsoft Visual Studio 2008 and create a new Windows Form Application for C#. The Form will look like this.


After creating a Windows Form Application, go to the solution explorer and click the “code view“.



In the code view, declare the variables for counting the controls that will be added and setting up the location of the controls in the Form.

After declaring variables, create a method for creating a Button.

Then, create a method for adding another button when clicked.

Lastly, do this following codes for displaying the button on the first load of the form.





For all students who need programmer for your thesis system or anyone who needs a sourcecode in any programming languages. You can contact me @ :


Email – [email protected]
Mobile No. – 09305235027 – tnt

Looking for more source code? Type your keyword here here!


Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.