473,406 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Problem about listview

I'm having a problem now.
How to count item that I selected in listview (multiselect). So I select more than 1.

I hope the solving for my problem.

Thank's
Nov 29 '07 #1
12 1271
hariharanmca
1,977 1GB
Use check boxe in listview. That will be easy to count.
Nov 29 '07 #2
Mohan Krishna
115 100+
I'm having a problem now.
How to count item that I selected in listview (multiselect). So I select more than 1.

I hope the solving for my problem.

Thank's
Hi
May this be helpful to you...
Expand|Select|Wrap|Line Numbers
  1. Private Sub List1_Click()
  2.     Label1.Caption = List1.SelCount
  3. End Sub
  4.  
ALL THE BEST!
respond is it helpful...
Nov 29 '07 #3
lotus18
866 512MB
Hi
May this be helpful to you...
Expand|Select|Wrap|Line Numbers
  1. Private Sub List1_Click()
  2.     Label1.Caption = List1.SelCount
  3. End Sub
  4.  
ALL THE BEST!
respond is it helpful...
Hi Mohan Krishna

faiz03l is referring to a listview and not on listbox : )

Rey Sean
Nov 30 '07 #4
Mohan Krishna
115 100+
Hi Mohan Krishna

faiz03l is referring to a listview and not on listbox : )

Rey Sean
Hi Lotus

I am sorry!

May this help...
Expand|Select|Wrap|Line Numbers
  1.     Dim iCheked, iSelected As Integer
  2.     For Each itm In Me.ListView1.ListItems
  3.         With itm
  4.             If .Checked Then                'checked?
  5.                 iChecked = iChecked + 1
  6.             End If
  7.             If .Selected Then
  8.                 iSelected = iSelected + 1   'selected?
  9.             End If
  10.         End With
  11.     Next
  12.     MsgBox "Checked = " & iCheked & vbLf & "Selected = " & iSelected
  13.  
ThanQ
Nov 30 '07 #5
lotus18
866 512MB
Hi Lotus

I am sorry!

May this help...
Expand|Select|Wrap|Line Numbers
  1.     Dim iCheked, iSelected As Integer
  2.     For Each itm In Me.ListView1.ListItems
  3.         With itm
  4.             If .Checked Then                'checked?
  5.                 iChecked = iChecked + 1
  6.             End If
  7.             If .Selected Then
  8.                 iSelected = iSelected + 1   'selected?
  9.             End If
  10.         End With
  11.     Next
  12.     MsgBox "Checked = " & iCheked & vbLf & "Selected = " & iSelected
  13.  
ThanQ
Hi Mohan

Have you tried getting the number of selected items without using a checkbox from the listview?

Rey Sean
Nov 30 '07 #6
Mohan Krishna
115 100+
Hi Mohan

Have you tried getting the number of selected items without using a checkbox from the listview?

Rey Sean
Yeah!

I got no. of selected items but not the checked items.
Nov 30 '07 #7
hariharanmca
1,977 1GB
There I told use check box in list view, and it's easy to see the checked items.
Nov 30 '07 #8
lotus18
866 512MB
Yeah!

I got no. of selected items but not the checked items.
Hello Mohan

Sorry I didn't notice that it also counts the no. of selected items. I think I'm going to wear a reading glass : )

Good job Mohan.

Rey Sean
Nov 30 '07 #9
There I told use check box in list view, and it's easy to see the checked items.

Sorry, I'm a beginer.
Can you tell me how to add check box in list view?

And for all thank you for your help...
Dec 3 '07 #10
lotus18
866 512MB
Sorry, I'm a beginer.
Can you tell me how to add check box in list view?

And for all thank you for your help...
Hi faiz03l

From your listview, right-click then select Properties > General tab > Checkboxes

Rey Sean
Dec 3 '07 #11
hariharanmca
1,977 1GB
From your listview, right-click then select Properties > General tab > Checkboxes and check that Checkboxes checkbox.
Dec 3 '07 #12
Thank you...

I has 1 question again, how to delete teks line by line?
Dec 4 '07 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Steph. | last post by:
I use a ListView in a form to display Data from an SQL db. My problem is that I can fill the listview in less than a second when I show the form AFTER filling the listview, but I take 35...
1
by: newbie001 | last post by:
I have the following code in a listview control's initList function (called from form_load event). i can't understand why the listview box still appears blank with no columns or listview items. ...
1
by: J_Max | last post by:
Hello, This might be a really easy question, but... I am developing a simple Smart Device application that uses a listview. I have a function that adds a item to the listview - code is below. I...
3
by: Larry | last post by:
I've set up a list of image filesnames in a listview control(lvSrcFileList), I'm using the selectedIndexChange event to select which file is being displayed in a picturebox control(pbImagePreview)....
7
by: David Schwartz | last post by:
I am using a few ActiveX ListViews in my VB.NET Windows Forms application. I have the ListView's HotTracking property set to False, yet when I move the mouse over an item in the ListView (without...
2
by: Matt Michael | last post by:
Hi, I'm having a problem working with a listview in an application I'm writing. Currently, whenever the selectedindex changed event fires, it loads up a htmledit control, and other labels on the...
7
by: Dino Buljubasic | last post by:
Hi, I am using C# 2.0 (VS2005) to build my user control that contains a number of dynamically loaded ListViews. ListViewItems have their ForeColor properties set to either black or blue to...
12
by: garyusenet | last post by:
I have had no replies to my previous post so perhaps I didn't write it good enough. Please excuse new thread but i wanted to break from the last thread hopefully this thread will be better. ...
2
by: Paul W | last post by:
Hello, My problem concerns the shell. If there's a better forum for this post, please let me know. I'm trying to create a ListView control that displays the contents of a folder with all the...
0
by: =?Utf-8?B?SWdvcg==?= | last post by:
Hi everyone! I have some strange behavior of ListView control in WPF. We are developing application in C#. I created ListView with some items and set SelectedIndex to some index in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.