Results 1 to 6 of 6

Thread: locking textboxes in one foul swoop.*RESOLVED*

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2001
    Location
    ottawa, canada
    Posts
    233

    locking textboxes in one foul swoop.*RESOLVED*

    I have several textboxes within a frame and would like all of them to be locked. Rather than individually locking every textbox, is there a faster way?

    ideally, i would prefer to disenable the whole frame, but the frame title is then greyed out.

    Any help would be appreciated..
    Last edited by sparkash; Jan 11th, 2003 at 01:17 PM.

  2. #2
    Frenzied Member Blobby's Avatar
    Join Date
    Oct 2001
    Location
    England
    Posts
    1,512
    Only way to do it would be to create each textbox as an element of an array so Text1(0), Text1(1), Text1(2) etc. Then you could use of For-Next loop to enable=false them.
    There are 3 types of people in this world.........those that can count, and those that can't.

    Blobby

  3. #3

  4. #4
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    I just noticed the "in a frame" part, so...
    VB Code:
    1. Dim ctl As Control
    2.    
    3.     For Each ctl In Controls
    4.         If TypeOf ctl Is TextBox Then
    5.             If ctl.Container.Name = Frame1 Then
    6.                 ctl.Locked = True
    7.             End If
    8.         End If
    9.     Next

  5. #5
    Frenzied Member Blobby's Avatar
    Join Date
    Oct 2001
    Location
    England
    Posts
    1,512
    You have far too much time on your hands Martin
    There are 3 types of people in this world.........those that can count, and those that can't.

    Blobby

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Nov 2001
    Location
    ottawa, canada
    Posts
    233
    Once again, Thanks Martin.

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