Click here to Skip to main content
15,896,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am using ListBox controls. when i select the multiple values, just i want to store those values in one variables.

But,my code showing all the count values.

I need only selected count values.

what is the problem...?

see my code
------------
VB
Dim PrjType As String
Dim _count As Integer = lstprojtype.Items.Count
If _count <> 0 Then
    For i As Integer = 0 To _count - 1
        PrjType = lstprojtype.Items(i).Value
    Next
End If
PrjType = Left(PrjType, Len(PrjType) - 2)
Posted
Updated 26-Dec-11 23:53pm
v2

1 solution

use this code
Dim a As Integer = 0
Dim str As String = ""
While a < CheckedListBox1.CheckedItems.Count
str = str & CheckedListBox1.CheckedItems(a).ToString
a = a + 1
End While
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900