fast check

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Maarten

    fast check

    hi all

    i'm usung this command to check 16 checkboxes

    for inti = 1 to 16
    check1(inti) = vbchecked
    next inti

    but with this ommand it wil loop 16 times trough the code

    is there a way it will set the checkboxes at once

    thanks maarten


  • TecCRC

    #2
    Re: fast check

    For i = 1 To 16
    Check1(i).Value = 1
    Next

    Posted Via Usenet.com Premium Usenet Newsgroup Services
    ----------------------------------------------------------
    ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
    ----------------------------------------------------------
    Best Usenet Service Providers 2025 ranked by Newsgroup Access Newsservers, Usenet Search, Features & Free Trial. Add VPN for privacy.

    Comment

    • Randy Birch

      #3
      Re: fast check

      What improvement does this introduce, and how does it address the OP's
      question?

      --


      Randy Birch
      MS MVP Visual Basic



      "TecCRC" <teccrc@doublev e.com> wrote in message
      news:Xns957FB77 1B4169teccrcdou blevecom@38.119 .100.122...
      : For i = 1 To 16
      : Check1(i).Value = 1
      : Next
      :
      : Posted Via Usenet.com Premium Usenet Newsgroup Services
      : ----------------------------------------------------------
      : ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
      : ----------------------------------------------------------
      : http://www.usenet.com

      Comment

      • Randy Birch

        #4
        Re: fast check

        No, one way or another you have to access each control individually. You
        can use the loop, where the controls are in a sequential control array as
        you have done, or use the For Each method, adding restrictions as required
        to have the code address the controls you want, eg..

        for each ctl in controls
        if typeof ctl is CheckBox then
        ctl.checked = vbchecked
        end if
        next

        --


        Randy Birch
        MS MVP Visual Basic



        "Maarten" <gurkjaan@hotma il.com> wrote in message
        news:416a6b27$0 $22086$ba620e4c @news.skynet.be ...
        : hi all
        :
        : i'm usung this command to check 16 checkboxes
        :
        : for inti = 1 to 16
        : check1(inti) = vbchecked
        : next inti
        :
        : but with this ommand it wil loop 16 times trough the code
        :
        : is there a way it will set the checkboxes at once
        :
        : thanks maarten
        :
        :

        Comment

        • Rick Rothstein

          #5
          Re: fast check

          > for each ctl in controls[color=blue]
          > if typeof ctl is CheckBox then
          > ctl.checked = vbchecked[/color]

          ctl.Value = vbChecked
          [color=blue]
          > end if
          > next[/color]

          Rick - MVP

          Comment

          • Randy Birch

            #6
            Re: fast check

            yea, I was thinking option buttons. Thanks.

            --


            Randy Birch
            MS MVP Visual Basic



            "Rick Rothstein" <rickNOSPAMnews @NOSPAMcomcast. net> wrote in message
            news:O_WdnYpWDt gzVPfcRVn-hA@comcast.com. ..
            : > for each ctl in controls
            : > if typeof ctl is CheckBox then
            : > ctl.checked = vbchecked
            :
            : ctl.Value = vbChecked
            :
            : > end if
            : > next
            :
            : Rick - MVP

            Comment

            Working...