Click here to Skip to main content
15,902,635 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Random letters Pin
harveyhanson18-Feb-07 12:01
harveyhanson18-Feb-07 12:01 
GeneralRe: Random letters Pin
TwoFaced18-Feb-07 19:28
TwoFaced18-Feb-07 19:28 
QuestionDisplay Pin
Misanthropia6-Feb-07 5:53
Misanthropia6-Feb-07 5:53 
AnswerRe: Display Pin
Christian Graus6-Feb-07 9:42
protectorChristian Graus6-Feb-07 9:42 
QuestionListView Pin
CodingYoshi6-Feb-07 4:40
CodingYoshi6-Feb-07 4:40 
AnswerRe: ListView Pin
TwoFaced6-Feb-07 7:20
TwoFaced6-Feb-07 7:20 
GeneralRe: ListView Pin
CodingYoshi6-Feb-07 14:36
CodingYoshi6-Feb-07 14:36 
GeneralRe: ListView Pin
TwoFaced6-Feb-07 16:34
TwoFaced6-Feb-07 16:34 
I think things are a little clearer. I've now got a general picture of your scenerio. For all I know there is a brilliant solution to your overall problem, but I don't have one. However, I'll give you what I've got. You can add items to the listview with a key and then access that item using that key. Now from what I understand you've got food items in listviewB. So the name of the item would be the key. The user selects say 'Breakfast' from ListViewA. You then get the food items the user wants for breakfast and store that in an arraylist. You could then access each item in ListViewB directly by using the items name because you used the name as the key. Hopefully some code will make this clearer. Here is a little example which shows what I'm talking about.
'---Add items with keys---
With ListView1.Items
    .Add("Steak", "Steak", "")
    .Add("Apple", "Apple", "")
    .Add("Rice", "Rice", "")
End With

'---Uncheck previous items---
For i As Integer = ListView1.CheckedItems.Count - 1 To 0 Step -1
    ListView1.CheckedItems(i).Checked = False
Next

Dim itemsToSelect As String() = {"Steak", "Rice"}
For Each item As String In itemsToSelect
    ListView1.Items(item).Checked = True
Next
One thing I don't understand is why does ListViewB have check boxes and why are you checking the items instead of filling ListViewB with just the items the user had selected for 'Breakfast'? It seems to me this would be a nicer approach but maybe there is more to this that I don't understand yet. Either way the code I posted should give you an idea of how to more directly access each item instead of looping through all the items in the list.
Questiondelay ? Pin
Narfix6-Feb-07 4:26
professionalNarfix6-Feb-07 4:26 
QuestionHow can i make an installable file...? Pin
fmlove6-Feb-07 4:10
fmlove6-Feb-07 4:10 
AnswerRe: How can i make an installable file...? Pin
Taylor Kobani6-Feb-07 5:21
Taylor Kobani6-Feb-07 5:21 
AnswerRe: How can i make an installable file...? Pin
FeRtoll6-Feb-07 6:21
FeRtoll6-Feb-07 6:21 
GeneralRe: How can i make an installable file...? Pin
fmlove6-Feb-07 22:46
fmlove6-Feb-07 22:46 
GeneralRe: How can i make an installable file...? Pin
FeRtoll7-Feb-07 2:53
FeRtoll7-Feb-07 2:53 
QuestionHow can i make an installable file...? Pin
fmlove6-Feb-07 4:10
fmlove6-Feb-07 4:10 
AnswerRe: How can i make an installable file...? Pin
Kschuler6-Feb-07 10:12
Kschuler6-Feb-07 10:12 
QuestionXML Pin
samerh6-Feb-07 3:57
samerh6-Feb-07 3:57 
AnswerRe: XML Pin
Christian Graus6-Feb-07 9:43
protectorChristian Graus6-Feb-07 9:43 
QuestionScreensaver to play first... Pin
Dave McCool6-Feb-07 3:50
Dave McCool6-Feb-07 3:50 
AnswerRe: Screensaver to play first... Pin
Taylor Kobani6-Feb-07 5:29
Taylor Kobani6-Feb-07 5:29 
QuestionProblems with my Watch Window in debugging mode Pin
ONeil Tomlinson6-Feb-07 2:13
ONeil Tomlinson6-Feb-07 2:13 
Questioni want to create conaction Between web cam and PictureBox Pin
Ahmed El-Badry6-Feb-07 0:52
Ahmed El-Badry6-Feb-07 0:52 
AnswerRe: i want to create conaction Between web cam and PictureBox Pin
Christian Graus6-Feb-07 0:59
protectorChristian Graus6-Feb-07 0:59 
Questioni want to add Button and imge in DataGrid VS.net2003 Pin
Ahmed El-Badry6-Feb-07 0:45
Ahmed El-Badry6-Feb-07 0:45 
AnswerRe: i want to add Button and imge in DataGrid VS.net2003 Pin
Taylor Kobani6-Feb-07 5:32
Taylor Kobani6-Feb-07 5:32 

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.