dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Iterating objects

  1. #1
    Radha Guest

    Iterating objects


    For Each MyObject In Me ' Iterate through each element.
    If MyObject.Name = "Frame1" Then
    list_height = 10
    End If
    next


    Here, how can I know that myobject.type is a text box or frame etc. instead
    of name?

    Is there anything like MyObject.type ?



  2. #2
    Karl E. Peterson Guest

    Re: Iterating objects

    TypeName()
    --
    http://www.mvps.org/vb


    "Radha" <radha@hotmail.com> wrote in message news:39188d3a$1@news.devx.com...
    >
    > For Each MyObject In Me ' Iterate through each element.
    > If MyObject.Name = "Frame1" Then
    > list_height = 10
    > End If
    > next
    >
    >
    > Here, how can I know that myobject.type is a text box or frame etc. instead
    > of name?
    >
    > Is there anything like MyObject.type ?
    >
    >




  3. #3
    Mike Culley Guest

    Re: Iterating objects


    If TypeOf MyObject Is Frame then

    "Radha" <radha@hotmail.com> wrote:
    >
    >For Each MyObject In Me ' Iterate through each element.
    > If MyObject.Name = "Frame1" Then
    > list_height = 10
    > End If
    >next
    >
    >
    >Here, how can I know that myobject.type is a text box or frame etc. instead
    >of name?
    >
    >Is there anything like MyObject.type ?
    >
    >



  4. #4
    Joe Guest

    Re: Iterating objects


    ' To Loop through the controls collection in a form
    ' and look for text boxes

    Dim ctlControl as Control

    For Each ctlControl in Controls
    If TypeOf ctlControl is TextBox then
    ctlControl.Text = ""
    End If
    Next



    "Radha" <radha@hotmail.com> wrote:
    >
    >For Each MyObject In Me ' Iterate through each element.
    > If MyObject.Name = "Frame1" Then
    > list_height = 10
    > End If
    >next
    >
    >
    >Here, how can I know that myobject.type is a text box or frame etc. instead
    >of name?
    >
    >Is there anything like MyObject.type ?
    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center