Results 1 to 8 of 8

Thread: Clear All Textbox

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2003
    Posts
    110

    Clear All Textbox

    i have few text boxes on my form.

    but they are inside one or more group boxes.
    means they are directly not placed on the form.

    and there are more than one group box on the form

    i want to clear all the text boxes.

    how do i do that
    Anis Bombaywala

  2. #2
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    you can loop thru the group boxes and set each textbox to an empty string.
    Dont gain the world and lose your soul

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    try this
    VB Code:
    1. Dim c As Control
    2.         For Each c In Me.Controls
    3. If TypeOf ctrl Is TextBox Then
    4.    c.Text = ""
    5. Next
    6. END if

  4. #4
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    lol pirate that wont work for what he asked for, he says that the txtboxes are in group boxes then that code simple wont work...what he'll have to do is like the other guy said make a loop thru the form looking for txtboxes and groupboxes..and when he finds groupboxes he will have to make another loop thru all it's controls looking for txtboxes
    \m/\m/

  5. #5
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Sorry, I should read the post carefully next time

  6. #6
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    i will forgive u this time, next time i wont be so soft
    \m/\m/

  7. #7
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by PT Exorcist
    i will forgive u this time, next time i wont be so soft
    lol .

  8. #8
    Frenzied Member MrGTI's Avatar
    Join Date
    Oct 2000
    Location
    Ontario, Canada
    Posts
    1,277

    Question

    What about making the different sets of TextBoxes into collections (arrays of just TextBoxes)? Wouldn't that work as well?
    ~Peter


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