Beginner in C# - How to create and delete a dynamic Textbox accordingly?

  • Thread starter Thread starter FelixWong
  • Start date Start date
F

FelixWong

Guest
It is possible to create a WBS diagram using C#?

My first step is to create multiple textbox as charts. However, i don't know how to create a list of textbox for the loop to add or delete the chart. I am trying to create a WBS chart using C# based on WBS module which can add and store the information(using top-down approach). Can somebody give some suggestions to create WBS?

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MIni_Project
{
public partial class RemoveChart : Form
{
public RemoveChart()
{
InitializeComponent();
}
int left = 20;
int top = 70;
int count = 0;


private void button1_Click(object sender, EventArgs e)
{
addChart();
}

private void addChart()
{
count++;
int addCount = 0;

for (int i = 0; i < count; i++)
{
TextBox chartbox = new TextBox();
this.Controls.Add(chartbox);
chartbox.Multiline = true;
chartbox.Width = 80;
chartbox.Height = 60;
chartbox.Font = new Font("Times New Roman", 10.0F, FontStyle.Regular);
chartbox.Location = new Point(left, top);
left += 100;
count--;
addCount++;

for (int j = 0; j < addCount; j++)
{
TextBox[] box = new TextBox[addCount];

}
}

}


}
}

Continue reading...
 
Back
Top