Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 27-02-2009
Member
 
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,
Reply With Quote
  #2  
Old 27-02-2009
Member
 
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.
Reply With Quote
  #3  
Old 27-02-2009
Member
 
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
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to lock a textbox need property through code."
Thread Thread Starter Forum Replies Last Post
How to calculate the Master Code of Nokia phone in case you forget your security/lock code? darshit Tips & Tweaks 25 28-12-2011 07:58 PM
Nokia n96 - lock code Calusa Portable Devices 8 20-10-2010 08:49 AM
Excel/VBA: Copying text from UserForm Textbox to a Worksheet Textbox Neil Ives Software Development 2 20-08-2010 01:23 AM
HTC HD2 Lock code fails Rastogi B Portable Devices 4 19-04-2010 11:51 PM
Set maxlength property on multiline textbox in Asp.net Miss Kelly Software Development 2 17-01-2009 05:57 PM


All times are GMT +5.5. The time now is 02:40 AM.