Results 1 to 5 of 5

Thread: Looping through controls

Hybrid View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2000
    Posts
    230

    Question

    I have three flexgrids on my form and want to programmitically loop through them.

    I tried

    Code:
    Dim cntrl as MSHFlexGrid
    
    
    For Each cntrl in Me.Controls
          'process info
    next cntrl
    What am I doing wrong?
    Shawn Hull
    VB6, SP3 (Professional Edition)

  2. #2
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    Not sure but just put Next, instead of Next cntrl

  3. #3
    New Member
    Join Date
    Nov 2000
    Posts
    3

    Question

    What seems to be the problem?

    I tried this code on mine and it walked through it fine.

    code_baron

  4. #4
    Hyperactive Member tumblingdown's Avatar
    Join Date
    Mar 2000
    Posts
    362
    Try this

    Code:
    Dim ctl As Control
    '/
       For Each ctl In Me.Controls
          If TypeName(ctl) = "MSHFlexGrid" Then
             '/ do your funky stuff
          End If
       Next
       '/
       Set ctl = Nothing


    td.

    "One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig


    [email protected]

    "but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.

  5. #5
    Hyperactive Member tumblingdown's Avatar
    Join Date
    Mar 2000
    Posts
    362
    oh, and isn't it MSFlexGrid, not MSHFlexGrid?


    td.
    "One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig


    [email protected]

    "but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.

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