|
-
Jun 15th, 2001, 08:50 AM
#1
Thread Starter
Member
disabling textbox in the form
if we disable any text box in the form it display grey text in it. is it possible to display text dark black even it is enable = false???
how it is possible to do this???
thanx in advance
firoz
-
Jun 15th, 2001, 08:55 AM
#2
Registered User
Try putting the text box in a frame and diabling the frame.
-
Jun 15th, 2001, 08:57 AM
#3
Addicted Member
try changing the backgroung colour of the text box once disabled!!
not sure if it will work but have a go!!
another way could be doing it from the windows settings in Control pannel!
-
Jun 15th, 2001, 09:02 AM
#4
Junior Member
you could use the locked property of the textbox control which disables the textbox from being edited but does not greyout the text.
eg. txtName.Locked = true.
this can be done in Code or in the properties of the TextBox control.
-
Jun 15th, 2001, 09:02 AM
#5
Thread Starter
Member
thanku for ur replay.
we can do the same by putting readonly property of the text box true. but by this trick tab stop of the text box will be there.
the background of the textbox remain the same(white) but the text color ofthe textbox change to the grey.
please try if it is possible by subclassing the text box???
thanx once again!!
firoz
-
Jun 15th, 2001, 09:09 AM
#6
Registered User
I tested it and this works for me. Add a frame to the form, put the textbox in the frame and a command button, then add this code. Click the command button to enable/disable the textbox.
Code:
Private Sub Command1_Click()
Me.Frame1.Enabled = Not (Me.Frame1.Enabled)
End Sub
Private Sub Form_Load()
Me.Frame1.BorderStyle = 0
End Sub
-
Jun 15th, 2001, 09:31 AM
#7
Thread Starter
Member
thanku all gays for ur help. thanku very much all of u.
using frame for all textbox may require lot of programming in the form. speacially when u have lot of text boxes in the form.
-
Jun 15th, 2001, 09:36 AM
#8
Registered User
firoz,
using frame for all textbox may require lot of programming in the form. speacially when u have lot of text boxes in the form.
Not really, you are just disabling the frame instead of the actual textbox, so it should take exactly the same code. At design time set the border style of the frame to none. At run time you just need 1 line:
Me.Frame1.Enabled = true/false
Also it sounds like you are using a text box to display read only data, in which case I would use a label instead of a textbox .
-
Jun 15th, 2001, 09:42 AM
#9
So Unbanned
-
Jun 15th, 2001, 09:44 AM
#10
Addicted Member
-
Jun 15th, 2001, 09:50 AM
#11
Thread Starter
Member
Ops!!
typing mistack!!!!
thanku very much Nucleus for ur help. u got the right think. i want to display matters in the text box only. if user click on edit button then the all related textbox should able to accept the input.
thanku once again. it working adjact i want.
-
Jun 15th, 2001, 09:54 AM
#12
Registered User
I missed it first time around , classic.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|