Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 9th, 2009, 05:49 AM
Registered User
 
Join Date: Aug 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Question Selecting all the Listview information using selectall function

i simple want when user click on the select all checkbox.all the checkboxes of list view should be filled with check sign.which is working fine.but problem is that when user click again on the checkbox .checksign still stay there.kindly let me know the idea any help would be highly appreciated.
Code:
Private Sub Check1_Click() 
Call SelectAll 
End Sub 
Private Function SelectAll() As Boolean 
    Dim Item As listitem 

    For Each Item In ListView1.ListItems 
        Item.Checked = True 
    Next 
  
    SelectAll = True 
End Function
 
Old August 9th, 2009, 10:51 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Hello. Just reading your code you realize something, you are cheking the items (in Item.Checked = True), but you never do the opposite (Item.Checked = false). Just replace the True with Check1.checked, and you will have what you want.
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
ListView asters VB.NET 2002/2003 Basics 0 March 27th, 2008 05:00 AM
selecting a row in a listview control debbiecoates Pro VB Databases 0 February 26th, 2008 07:48 AM
problem selecting listview item method Visual C++ 0 July 7th, 2006 04:06 PM
listView AristotleYu ASP.NET 2.0 Basics 0 May 11th, 2006 04:54 AM
Selecting a ListView item bmains Pro VB.NET 2002/2003 0 January 22nd, 2005 11:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.