Click here to Skip to main content
16,020,840 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Cannot find ContextMenu control in vb.net Pin
Andraw Tang4-Aug-10 10:25
Andraw Tang4-Aug-10 10:25 
GeneralRe: Cannot find ContextMenu control in vb.net Pin
cyberexel4-Aug-10 23:11
cyberexel4-Aug-10 23:11 
QuestionGet Primary Field and Foreign Fields from Access Table Pin
cyberexel4-Aug-10 4:49
cyberexel4-Aug-10 4:49 
AnswerRe: Get Primary Field and Foreign Fields from Access Table Pin
cyberexel5-Aug-10 6:39
cyberexel5-Aug-10 6:39 
QuestionRemote TCP file Transferring Pin
rezafathi3-Aug-10 14:15
rezafathi3-Aug-10 14:15 
AnswerRe: Remote TCP file Transferring Pin
Garth J Lancaster3-Aug-10 17:25
professionalGarth J Lancaster3-Aug-10 17:25 
Question[VB10] Check which ListBox items are selected and which are not Pin
The Mighty Atom3-Aug-10 9:43
The Mighty Atom3-Aug-10 9:43 
AnswerRe: [VB10] Check which ListBox items are selected and which are not Pin
Eddy Vluggen3-Aug-10 10:51
professionalEddy Vluggen3-Aug-10 10:51 
A ListBox holds a SelectedItems[^] collection that you can query;
VB.NET
' Create a ListBox
Dim testBox As ListBox = New ListBox()
testBox.Parent = Me
testBox.Dock = DockStyle.Fill
testBox.SelectionMode = SelectionMode.MultiSimple
Me.Controls.Add(testBox)

' Add some testitems
Dim i As Integer
For i = 0 to 10
   testBox.Items.Add ("test " & i)
Next i

' Select items 2 & 7
testBox.SelectedItems.Clear()
testBox.SelectedItems.Add(testBox.Items(2))
testBox.SelectedItems.Add(testBox.Items(7))

' Iterate all items, verifying if they're selected
For Each someItem in testBox.Items
	If (testBox.SelectedItems.Contains(someItem)) Then
		Debug.WriteLine(someItem & " was selected")
	End If
Next someItem

' Or, iterate the selected ones only;
For Each selectedItem In testBox.SelectedItems
	Debug.WriteLine(selectedItem & " was selected")
Next

I are Troll Suspicious | :suss:

GeneralRe: [VB10] Check which ListBox items are selected and which are not Pin
The Mighty Atom3-Aug-10 11:53
The Mighty Atom3-Aug-10 11:53 
GeneralRe: [VB10] Check which ListBox items are selected and which are not Pin
Luc Pattyn3-Aug-10 12:31
sitebuilderLuc Pattyn3-Aug-10 12:31 
GeneralRe: [VB10] Check which ListBox items are selected and which are not [modified] Pin
The Mighty Atom3-Aug-10 13:01
The Mighty Atom3-Aug-10 13:01 
GeneralRe: [VB10] Check which ListBox items are selected and which are not Pin
The Mighty Atom4-Aug-10 7:14
The Mighty Atom4-Aug-10 7:14 
AnswerRe: [VB10] Check which ListBox items are selected and which are not Pin
Luc Pattyn4-Aug-10 8:12
sitebuilderLuc Pattyn4-Aug-10 8:12 
GeneralRe: [VB10] Check which ListBox items are selected and which are not Pin
The Mighty Atom4-Aug-10 8:46
The Mighty Atom4-Aug-10 8:46 
AnswerRe: [VB10] Check which ListBox items are selected and which are not Pin
Luc Pattyn4-Aug-10 9:25
sitebuilderLuc Pattyn4-Aug-10 9:25 
GeneralRe: [VB10] Check which ListBox items are selected and which are not Pin
The Mighty Atom4-Aug-10 9:45
The Mighty Atom4-Aug-10 9:45 
GeneralRe: [VB10] Check which ListBox items are selected and which are not Pin
Luc Pattyn4-Aug-10 11:42
sitebuilderLuc Pattyn4-Aug-10 11:42 
QuestionInput data set changed dynamically according to option selection in VB.net 2005 Pin
Andraw Tang2-Aug-10 12:03
Andraw Tang2-Aug-10 12:03 
AnswerRe: Input data set changed dynamically according to option selection in VB.net 2005 Pin
Eddy Vluggen3-Aug-10 10:55
professionalEddy Vluggen3-Aug-10 10:55 
GeneralRe: Input data set changed dynamically according to option selection in VB.net 2005 Pin
Andraw Tang4-Aug-10 3:49
Andraw Tang4-Aug-10 3:49 
GeneralRe: Input data set changed dynamically according to option selection in VB.net 2005 Pin
Eddy Vluggen4-Aug-10 4:21
professionalEddy Vluggen4-Aug-10 4:21 
GeneralRe: Input data set changed dynamically according to option selection in VB.net 2005 Pin
Andraw Tang4-Aug-10 4:39
Andraw Tang4-Aug-10 4:39 
Questiondata access sample project Pin
soulrebelpd2-Aug-10 11:05
soulrebelpd2-Aug-10 11:05 
AnswerRe: data access sample project Pin
Yusuf2-Aug-10 12:48
Yusuf2-Aug-10 12:48 
GeneralRe: data access sample project Pin
soulrebelpd2-Aug-10 13:50
soulrebelpd2-Aug-10 13:50 

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.