Results 1 to 3 of 3

Thread: [2008] Searching for textboxes

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2007
    Posts
    520

    Cool [2008] Searching for textboxes

    Heya guys

    I was wondering is it possible to search a form for all the textboxes that contain a phrase in their name and then add all the values of thoses textboxes together?

    Thank youin advance

    Frosty

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: [2008] Searching for textboxes

    try this:

    vb Code:
    1. Dim counter As Integer = 0
    2.  
    3. For Each ctrl As Control In Me.Controls
    4.     If ctrl.GetType Is GetType(TextBox) AndAlso ctrl.Name.Contains("value") Then
    5.         counter += CInt(Val(ctrl.Text))
    6.     End If
    7. Next
    8.  
    9. MsgBox(counter)

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2007
    Posts
    520

    Re: [2008] Searching for textboxes

    what if the textbox required is part of a .Dll customer control

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