Results 1 to 4 of 4

Thread: looping combobox IN FRAME VB6 and retirn combobox name

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Location
    Italy-Napoli
    Posts
    2,171

    looping combobox IN FRAME VB6 and retirn combobox name

    my test code:

    ...
    Dim cCont As Control, name as string

    For Each cCont In Me.Controls.Frame1
    If TypeName(cCont) = "COMBOBOX" Then
    name=?????
    End If
    Next cCont
    ...

    i need only for frame1, in form have also frame2.

  2. #2
    Frenzied Member jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    1,869

  3. #3
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    13,617

    Re: looping combobox IN FRAME VB6 and retirn combobox name

    Your object in this case is cCont so if you want the name of it you would try cCont.Name

  4. #4
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    7,907

    Re: looping combobox IN FRAME VB6 and retirn combobox name

    like this:

    Code:
        Dim cCont As Control
        For Each cCont In Me.Controls
           If cCont.Container Is Frame1 Then
              Debug.Print cCont.name
           End If
        Next cCont
    Sam I am (as well as Confused at times).

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