Results 1 to 3 of 3

Thread: How to lock a textbox need property through code.

  1. #1
    Join Date
    Aug 2008
    Posts
    281

    How to lock a textbox need property through code.

    hello friends!

    How to lock a textbox need property through code.

    Please help,

  2. #2
    Join Date
    Jan 2009
    Posts
    36

    Re: How to lock a textbox need property through code.

    TextBox.Readonly=True

    This property is used to lock the text box to enter data.

  3. #3
    Join Date
    Apr 2008
    Posts
    1,948

    Re: How to lock a textbox need property through code.

    You can do 2 things, you can set the locked property to false or you can enable the textbox. The difference? When you lock a textbox you CAN select the text but you CAN'T modify it, when you disable a textbox it grays out so you are not to be able to select it nor modify it. If you're to lock it you'll need to set the Locked property to True (by default it's set to True), but if you're to disable it you'll need to set the enabled property to false. You can do that by selecting the textbox3 in your form and look for the enable property in your properties table.

    Here's how your code can be:

    Code:
    Private sub txtbox2_Change()
    'The sub txt1box2_Change will be triggered each time you write on the TextBox2
    If txtbox2.text = "aaa" and txtbox3.text = "123" then 'there's your condition
           txtbox3.locked = false
          'txtbox3.enabled = true 'use this if you want to do disable it insted of lock it
    End If

Similar Threads

  1. Replies: 25
    Last Post: 28-12-2011, 07:58 PM
  2. Nokia n96 - lock code
    By Calusa in forum Portable Devices
    Replies: 8
    Last Post: 20-10-2010, 08:49 AM
  3. Replies: 2
    Last Post: 20-08-2010, 01:23 AM
  4. HTC HD2 Lock code fails
    By Rastogi B in forum Portable Devices
    Replies: 4
    Last Post: 19-04-2010, 11:51 PM
  5. Set maxlength property on multiline textbox in Asp.net
    By Miss Kelly in forum Software Development
    Replies: 2
    Last Post: 17-01-2009, 05:57 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,519,698.00951 seconds with 17 queries