Can any one please help me in following in VB.NET2005:

I want that whenever the word setting appears a textbox would be created during runtime i.e here it appears for 4 times so 4 textboxes should be created, if it appears for 5 times then 5 textboxes would be created......
Can it be done using array? If yes then how?


<applicationSettings>
<WindowsApplication1.My.MySettings>
<setting name="Astrology" serializeAs="String">
<value>6</value>
</setting>
<setting name="Cricket" serializeAs="String">
<value>7</value>
</setting>
<setting name="Foreigncurrency" serializeAs="String">
<value>8</value>
</setting>
<setting name="Jobs" serializeAs="String">
<value>9</value>
</setting>
</WindowsApplication1.My.MySettings>
</applicationSettings>

Please help soon

I don't really understand you but I'll answer your thread subject

and I am sorry I'll write code in C# as I don't know VB.net at all :$

private int GetNumberOfControls()
{
//returns the number of control to be created
}

private void CreateTextbox()
{
TextBox textBox;

for(int i=0; i<GetNumberOfControls(); i++)
{
textBox = new TextBox();
textBox.Location = new Point(YourX, YourY);
..... //other properties
..... //other properties
this.Controls.Add(textBox);
}
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.