Click here to Skip to main content
15,921,113 members
Home / Discussions / C#
   

C#

 
QuestionMultiple Toolstrips(toolbars) under menustrip(menubar) can be drag dropped anywhere Pin
GunaChinna21-Dec-06 18:28
GunaChinna21-Dec-06 18:28 
AnswerRe: Multiple Toolstrips(toolbars) under menustrip(menubar) can be drag dropped anywhere Pin
GunaChinna21-Dec-06 22:42
GunaChinna21-Dec-06 22:42 
QuestionHow to calculate the difference between two dates Ignoring Weekends ? Pin
KhaledK21-Dec-06 14:48
KhaledK21-Dec-06 14:48 
AnswerRe: How to calculate the difference between two dates Ignoring Weekends ? Pin
Paul Conrad25-Dec-06 18:34
professionalPaul Conrad25-Dec-06 18:34 
Questionhow to convert string to utf-8 string in asp.net ? Pin
hdv21221-Dec-06 12:10
hdv21221-Dec-06 12:10 
AnswerRe: how to convert string to utf-8 string in asp.net ? Pin
Guffa21-Dec-06 21:29
Guffa21-Dec-06 21:29 
QuestionQuestion about Find Control Pin
MyRunner21-Dec-06 11:33
MyRunner21-Dec-06 11:33 
AnswerRe: Question about Find Control Pin
Mark Pryce-Maher22-Dec-06 2:22
Mark Pryce-Maher22-Dec-06 2:22 
I've written up how to add a button to a form, here : http://www.codeproject.com/useritems/DynamicallyAdding_Button.asp

To add a textbox, just follow the instructions but with a textbox instead of button.

something like this;

C#
TextBox myTextbox = new TextBox();

    //give the text box a good name, so you can refer to it later
    //perhaps keep the name the same but increment it.
myTextbox.Name = "inputbox_1";

myTextbox.Left = 100;
myTextbox.Top = 100;

this.Controls.Add(myTextbox);



To loop through a the text boxes, do something like this;


C#
foreach (object myTextBox in this.Controls )
{
    if (myTextBox.GetType().ToString() == "System.Windows.Forms.TextBox")
    {
    	TextBox thisText = (TextBox)myTextBox;
	MessageBox.Show(thisText.Name );
         
        // check its the right textbox
        if(thisText.Name.SubString(thisText.Name.Lenght-1)=="inputbox_")
        {
            // this is one of the textboxs I am looking for...
        } 
     }
}


This is very basic, friday afternoon, off the top of my head, just before xmas code. So there are better ways of doing this, but this should get you started..... . ...

MarkPM
QuestionIE Browser Helper Object - how to get clicked text/word? Pin
Tommy Svensson21-Dec-06 10:54
Tommy Svensson21-Dec-06 10:54 
Questionserver side coding in C# Pin
Tina P21-Dec-06 10:24
Tina P21-Dec-06 10:24 
AnswerRe: server side coding in C# Pin
led mike21-Dec-06 11:32
led mike21-Dec-06 11:32 
AnswerRe: server side coding in C# Pin
Christian Graus21-Dec-06 12:40
protectorChristian Graus21-Dec-06 12:40 
QuestionWhich logging library to use? Pin
chafey21-Dec-06 8:04
chafey21-Dec-06 8:04 
AnswerRe: Which logging library to use? Pin
Ravi Bhavnani21-Dec-06 8:39
professionalRavi Bhavnani21-Dec-06 8:39 
Questionvectors Pin
aavakas21-Dec-06 7:23
aavakas21-Dec-06 7:23 
AnswerRe: vectors Pin
Dan Neely21-Dec-06 7:33
Dan Neely21-Dec-06 7:33 
GeneralRe: vectors Pin
Dave Kreskowiak21-Dec-06 7:48
mveDave Kreskowiak21-Dec-06 7:48 
GeneralRe: vectors Pin
Dan Neely21-Dec-06 8:14
Dan Neely21-Dec-06 8:14 
AnswerRe: vectors Pin
aavakas21-Dec-06 7:38
aavakas21-Dec-06 7:38 
GeneralRe: vectors Pin
ednrgc21-Dec-06 8:46
ednrgc21-Dec-06 8:46 
GeneralRe: vectors Pin
Christian Graus21-Dec-06 8:57
protectorChristian Graus21-Dec-06 8:57 
GeneralRe: vectors Pin
ednrgc21-Dec-06 8:58
ednrgc21-Dec-06 8:58 
AnswerRe: vectors Pin
Drew McGhie21-Dec-06 7:38
Drew McGhie21-Dec-06 7:38 
AnswerRe: vectors Pin
aavakas21-Dec-06 7:44
aavakas21-Dec-06 7:44 
GeneralRe: vectors Pin
Dave Kreskowiak21-Dec-06 7:52
mveDave Kreskowiak21-Dec-06 7:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.