Cant create dynamically Textboxes in another form C#

  • Thread starter Thread starter Carlo Goretti
  • Start date Start date
C

Carlo Goretti

Guest
Cant create dynamically Checkboxes in another form..
Have tried everything but i cant get it working..
Here is my code:


files = Directory.GetFiles(KundMapp, "*.sql", SearchOption.AllDirectories);

var wordResults = new List<string>();
foreach (var f in files)
{

var wordList = ( from line in File.ReadAllLines(f) from Match match in Regex.Matches(line.ToLower(), @"(?<!\w)momentum_\w+") select match.Value ).ToList();

wordResults.AddRange(wordList);

}
var distinctWords = wordResults.Distinct().ToArray();
string result = string.Join("\n", distinctWords);

foreach (string s in distinctWords)
{
HittaNamn.Add(s);
}

//MessageBox.Show(result.ToString());

for(int i = 0; i < HittaNamn.Count(); i++)
{
textBoxes = new TextBox();
textBoxes.Tag = i;
textBoxes.Text = HittaNamn.ToString();
textBoxes.Location = new Point(form1.LaddaHittaErsätt.Location.X, form1.LaddaHittaErsätt.Location.Y + form1.LaddaHittaErsätt.Height + 25 + (i * 25));
form1.Controls.Add(textBoxes);
}
Thankful for help..

Continue reading...
 
Back
Top