-
Dec 20th, 2009, 10:19 PM
#1
Thread Starter
Lively Member
Using 2 for every statements?
is there any way to use 2 for every.... statements?
i want to load up my.settings and 1 list will make new toolstripdropdownitem and the other lists is for the tooltiptexts
or I could do it another way, but how can I check the index of items in a my.setting string collection? like if I want to get the text of index number 3 how do I do that? thanks
-
Dec 20th, 2009, 10:47 PM
#2
Re: Using 2 for every statements?
The fact that it's from My.Settings is irrelevant. A StringCollection is a StringCollection, and a StringCollection is basically the same as any other collection. If you want to get the String at index 3 then that's exactly what you do:
vb.net Code:
myString = myStringCollection(3)
I think what you want is actually simpler than you think. You can use a For Each loop and then use the current item inside the loop several times, e.g.
vb.net Code:
For Each str In My.Settings.MyStringCollection 'Use str here to create a menu item. 'Use str here to create a tool tip. Next
-
Dec 20th, 2009, 10:50 PM
#3
Thread Starter
Lively Member
Re: Using 2 for every statements?
hmm... I don't really understand the loop thing, but I'll try the mystring = mystringcollection(3) thing
so for me would i do
my.settings.(name)(indexnumber)
?
let me try
-
Dec 20th, 2009, 10:56 PM
#4
Thread Starter
Lively Member
Re: Using 2 for every statements?
using the for each str in my.settings.ddml (ddml is my string collection name)
i get an error saying like str needs a value or something.... like a number or i dunno
-
Dec 20th, 2009, 10:59 PM
#5
Thread Starter
Lively Member
Re: Using 2 for every statements?
o wait nevermind i got my.settings.ddm(number) to work thanks
i dunno wat i was doing before but thanks very much ur awesome
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|