Results 1 to 2 of 2

Thread: Type of Control/Object

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2000
    Location
    Rafaela (Argentine)
    Posts
    107

    Question

    I'm using a For Each structure to browse through the controls in a form. How can I know what type of control is each one?

    Code:
    For Each objCtrl In frmX.Controls
        ' Kind of control for objCtrl???
        ' CommandButton, ListBox, TextBox, etc.????
    Next objCtrl
    Thanks in advance

  2. #2
    Guest

    Wink

    Check this out

    For Each objCtrl In frmX.Controls
    If TypeOf objCtrl Is VB.ComboBox Then

    ElseIf TypeOf objCtrl Is VB.Label Then

    ElseIf TypeOf objCtrl Is VB.CheckBox Then

    ElseIf TypeOf objCtrl Is VB.TextBox Then

    End If

    Next ctl

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