Results 1 to 3 of 3

Thread: CheckedListBox All check

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2009
    Location
    Milan
    Posts
    810

    CheckedListBox All check

    I have a list box with three items in it. This has been disabled and I want to enable a button if all three are checked, i was looking for a CheckedChange type event in the MSDN but could not find anything.

    How can I do something like this?

  2. #2
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: CheckedListBox All check

    Hi,

    You can try something like this:

    Code:
    For i = 0 to CheckListBox1.Items.Count- 1
        If CheckListBox1.Checked(i) = True then
           Button1.Enabled = True
           End If
            Next
    Last edited by sparrow1; Jan 4th, 2010 at 06:05 AM.
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  3. #3
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: CheckedListBox All check

    Quote Originally Posted by AirlineSim View Post
    I want to enable a button if all three are checked
    Try this

    Code:
    Dim boolAllow as Boolean, i as long
    
    boolAllow = True
    
    For i = 0 to CheckListBox1.Items.Count- 1
        If CheckListBox1.Checked(i) = False then 
    	boolAllow = False
    	Exit For
        End If
    Next
    
    If boolAllow = True then Button1.Enabled = True
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width