---
title: "Working with creating dynamic control in c#"  
description: "Working with creating dynamic control in c#"  
author: "marcel ethan"  
published: 2013-06-15  
updated: 2013-06-15  
canonical: https://www.mindstick.com/forum/1183/working-with-creating-dynamic-control-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Working with creating dynamic control in c#

Hi [Developers](https://www.mindstick.com/articles/12875/blunders-you-must-avoid-while-hiring-java-developers-to-get-the-best-fulfilling-your-needs),

How can I create [Dynamic](https://www.mindstick.com/blog/11080/features-of-java-dynamic-complied-and-interpreted) [Label control](https://www.mindstick.com/articles/301/a-label-control-in-vb-dot-net) using C#?

\

## Replies

### Reply by Sumit Kesarwani

Hi Marcel,\
Its very easy to create a dynamic [control](https://www.mindstick.com/blog/197/asp-dot-net-repeater-control) in C#, following, lines of code will solve your problem.\

```
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms; namespace MinimizDemo{    public partial class Form4 : Form    {        public Form4()        {            InitializeComponent();        }        int cLeft = 1;         private void button1_Click(object sender, EventArgs e)        {            AddNewTextBox();        }        public System.Windows.Forms.Label AddNewTextBox()        {            System.Windows.Forms.Label txt = new System.Windows.Forms.Label();            this.Controls.Add(txt);            txt.Top = cLeft * 25;            txt.Left = 100;            txt.Text = "Label " + this.cLeft.ToString();            cLeft = cLeft + 1;            return txt;        }    }}
```


---

Original Source: https://www.mindstick.com/forum/1183/working-with-creating-dynamic-control-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
