---
title: "Arrange Button In c#"  
description: "Arrange Button In c#"  
author: "Manmohan Jha"  
published: 2013-11-18  
updated: 2013-11-18  
canonical: https://www.mindstick.com/forum/1744/arrange-button-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Arrange Button In c#

How to [auto](https://www.mindstick.com/forum/33810/remote-view-in-android-auto-cancel-custom-notification) arrange buttons like [text](https://www.mindstick.com/blog/301635/did-people-reinvent-texting-to-express-the-full-range-of-emotions) in [panel](https://www.mindstick.com/blog/11988/restructuring-corporate-offenses-government-appointed-panel-suggests-in-house-adjudication-system)/[container](https://www.mindstick.com/forum/159610/how-to-connect-a-windows-container-to-a-service-running-on-localhost) in c#\
\
Thx &[amp](https://www.mindstick.com/forum/156207/what-is-amp); regards\
Manmohan Jha

## Replies

### Reply by Sumit Kesarwani

Hi Manmohan,\
You can do like this:\

```
private void CreateButtonDynamic(int numberOfButton, string[] ButtonText){   for (int i = 0; i < numberOfButton; i++)   {      Button temp = new Button();      temp.Name = "button"+(i+1).ToString();      temp.Text = ButtonText[i];      temp.AutoSize = true;      temp.Location = new System.Drawing.Point(100, 100 + (25 * i));//please adjust location as per your need      temp.Tag = i;      temp.Click += new EventHandler(OnButtonClick);       this.Controls.Add(temp);    }}
```


---

Original Source: https://www.mindstick.com/forum/1744/arrange-button-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
