Hi,
I am making one windows application. In that application I have added one Textbox called "OTHER ITEAMS" and one Button called "MORE"
My question is : as an example i want to add 4 iteams in Textbox. So, 1st I will add one Item in Textbox then I will press MORE button at run time and I want another same size textbox as the 1st one and exactly under 1st one.
It's not fixed that everytome I have to add same number of Iteams in textbox.
So, how can I do this..?
I have also read the articles called Veating TextBoxes dynamically at runtime.
But, this article is for asp.net not for windows application.
Pls reply as soon as possible. :)
Loading


Ankit NandekarRank #703 · 3.4K reputationPosted Apr 11, 2011, 3:24 AM EDT
try this
TextBox myTextBox = new TextBox();
on More Button Click event write this code
this.Controls.Add(myTextBox);
if its working then plz mark as accepted answer.
Sahil Jani196 reputationPosted Apr 11, 2011, 3:35 AM EDT
This code is working fine but I want to add that textbox exactly under the textbox which I have already put.
How should I do that..? Can you help me for that..?
I have attached the screen shot also that How would I want..?
In that screen shot I have tried to put the image like, if i will press that add button then one another text box will be added exactly under the first one.
Thanks again for the reply.
Sahil Jani196 reputationPosted Apr 11, 2011, 3:38 AM EDT
This code is working fine but I want to add that textbox exactly under the textbox which I have already put.
How should I do that..? Can you help me for that..?
I have attached the screen shot also that How would I want..?
In that screen shot I have tried to put the image like, if i will press that add button then one another text box will be added exactly under the first one.
Thanks again for the reply.
Ankit NandekarRank #703 · 3.4K reputationPosted Apr 11, 2011, 4:00 AM EDT
Ankit NandekarRank #703 · 3.4K reputationPosted Apr 11, 2011, 4:26 AM EDT
myText.Location = new Point(90,40);
with the use of this you can put ur textbox where you want just set its x and y cordinates.