Results 1 to 3 of 3

Thread: selecting all in a groupbox [RESOLVED]

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489

    selecting all in a groupbox [RESOLVED]

    why wont this work? I get a message saying CHECKED IS NOT A MEMBER OF SYSTEM.WINDOES.FORMS..... yadda yadda


    VB Code:
    1. 'This will select all
    2.         If tab_TrblQue_chkViewAllorNone.CheckState = CheckState.Checked Then
    3.             Dim ctrl As Control
    4.             For Each ctrl In tab_TrblQue_grpMultiQueOptions.Controls
    5.  
    6.                 If TypeOf ctrl Is CheckBox Then
    7.                     ctrl.checked = True
    8.                     '
    9.                     '
    10.                     '
    11.                 End If
    12.  
    13.  
    14.             Next
    15.  
    16.             Exit Sub

    I'm trying to check all checkboxes in a groupbox by selecting a particular checkbox
    Last edited by Andy; Mar 25th, 2004 at 10:07 PM.

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Because the type Control doesn't have a checked property you need to cast it to the CheckBox type.

    DirectCast(ctrl, CheckBox).checked = True

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    ohhhhhhhhh......ok

    I thought that when you had the 'if' statement and checked for 'typeof', it automatically let you do that. kewl

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