Results 1 to 3 of 3

Thread: Comparing controls to datatypes? [Resolved]

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950

    Comparing controls to datatypes? [Resolved]

    How can I iterate through the Controls collection, checking whether the control is a textbox? Here's what I have so far:
    VB Code:
    1. For Each c In Controls
    2.             If c.GetType Then
    3.  
    4.             End If
    5.         Next
    Whatever I try after c.GetType gives me syntax errors. Thanks.
    Last edited by salvelinus; Dec 17th, 2003 at 08:38 AM.

  2. #2
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    try >>


    For Each c In Controls
    If typeof(c) is textbox Then

    End If
    Next

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    Thanks persianboy. I thought of that last night in a duh! moment. I'm porting a vba app in Access to vb.net, so sometimes just follow the code there w/o thinking. I appreciate the help.

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