|
| ||||||||||
| Tags: lock, property, textbox, vb dot net |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| How to lock a textbox need property through code.
How to lock a textbox need property through code. Please help, |
|
#2
| |||
| |||
| 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
| ||||
| ||||
| 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 |
![]() |
|
| Thread Tools | Search this Thread |
| |
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 06: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 04:57 PM |