Results 1 to 3 of 3

Thread: [RESOLVED] one small question

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2006
    Location
    Europe, Poland
    Posts
    19

    Resolved [RESOLVED] one small question

    Hi

    I have something like this:

    VB Code:
    1. Dim [B]ctl [/B]As Variant
    2. Private Sub Command1_Click()
    3. For Each ctl In Form1.Controls
    4. If TypeOf ctl Is TextBox Then
    5. ctl.Text = vbNullString
    6. End If
    7. Next
    8. End Sub

    Variable >> ctl << which I declared must be in type Variant? This variable takes the most memory - how this is really?

    thanks

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: one small question

    no.. u can use COntrol type

    VB Code:
    1. Dim ctl As [B]Control[/B]
    2. Private Sub Command1_Click()
    3.     For Each ctl In Form1.Controls
    4.         If TypeOf ctl Is TextBox Then
    5.             ctl.Text = vbNullString
    6.         End If
    7.     Next
    8. End Sub
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Mar 2006
    Location
    Europe, Poland
    Posts
    19

    Re: one small question

    Oouu, yeah, thanks very much

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