Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Nov 2001
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Count Forms In VB6 Project (VB6)

    Can anybody tell me how to return a count of the total number of forms in a VB6 project. I don't mean just the loaded forms (ie Forms.Count) - but ALL the Forms.

    Thanks.

    Dave.

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Count Forms In VB6 Project (VB6)

    If you have named all the forms with a prefix, like frmThis, frmThat, you could loop on each and increment a counter for those whose name started with "frm". That's what I do.

    For Each vbComp In vbComps
    if left$(vbComp.Name,3) = "frm" then
    i = i + 1
    end if
    Next
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Count Forms In VB6 Project (VB6)

    Hi,

    Don't know if it's the same in VB, but in VBA it looks like you can use:

    If vbComp.Type = vbext_ct_MSForm

    Gary

Posting Permissions

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