gomindi Posted January 9, 2003 Posted January 9, 2003 Here is an example of my code: Dim items() As String Dim s As String = nreader.ReadToEnd items = s.Split(New Char() {"|"c}) Dim anItem As String For Each anItem In items Here is where I am having a problem. I want the split information to show in individual text boxes. I don't know how to make this happen. Any clues? Next Thanks! Mindi Quote
*Gurus* divil Posted January 9, 2003 *Gurus* Posted January 9, 2003 Are these textboxes already set up? If not, you could initialize, populate and display textboxes on-the-fly in your loop, like so: t = New TextBox() t.Text = "the text for this item" t.Location = New Point(100, 100) 'Would have to vary throughout the loop Controls.Add(t) Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
gomindi Posted January 9, 2003 Author Posted January 9, 2003 Thank you so much for that info. It was really helpful. I have one more question, how would I get this loop to continue to run and create these text boxes on the fly until it has finished reading my text file? Quote
*Gurus* divil Posted January 9, 2003 *Gurus* Posted January 9, 2003 You posted some code above with the beginning of a loop, I assumed you would put it in that one. Just above that, with the other declarations you would declare t as type textbox, then go through adding them. Something like this, maybe? Dim items() As String Dim s As String = nreader.ReadToEnd items = s.Split(New Char() {"|"c}) Dim anItem As String Dim t As TextBox For Each anItem In items t = New TextBox() t.Text = anItem t.Location = New Point(100, 20 * items.IndexOf(anItem)) 'Would have to vary throughout the loop Controls.Add(t) Next Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.