General discussion

Locked

change color for a diasable field in acc

By legna_fg ·
How can I change the disabled field colors?

This conversation is currently closed to new comments.

11 total posts (Page 1 of 2)   01 | 02   Next
| Thread display: Collapse - | Expand +

All Comments

Collapse -

change color for a diasable field in acc

by ash_syed In reply to change color for a diasab ...

Hi ,
In response to your question ,
for instance u are having the textbox control or Label disabled , then u can
write a few statements to change its
backcolor or Forecolor using the RGB Function or the QBColor function .
Ex :
Let us assume the name of the label control is Label1
then :

Label1.Forecolor = RGB(255,0,0)
in this case the color red is assigned to the Label
I hp it answers u r question
Thanks

Collapse -

change color for a diasable field in acc

by legna_fg In reply to change color for a diasab ...

The question was auto-closed by TechRepublic

Collapse -

change color for a diasable field in acc

by ghartlieb In reply to change color for a diasab ...

2 approaches come to mind:

1) Use a procedure to disable a control, passing the control as a paramater, which also changes the BackColor property to the color of your choice OR

2) Write a loop such as:
Dim Ctl as Control
Clr = RGB(0,255,0) ' or color of your choice
For Each Ctl in Me.Controls
if Ctl.Disabled then Ctl.BackColor = Clr
next Ctl

This would work well in a Utilities module as a procedure used by many forms - just pass Me as a parameter.

This technique can be applied to using the Tag property to see if a control should be enable or disabled under certain conditions - you could set the color at that time as well.

Collapse -

change color for a diasable field in acc

by legna_fg In reply to change color for a diasab ...

The question was auto-closed by TechRepublic

Collapse -

change color for a diasable field in acc

by ghartlieb In reply to change color for a diasab ...

A correction to my previous answer:

You would use: IF NOT Ctl.Enabled THEN Ctl.BackColor = Clr

Collapse -

change color for a diasable field in acc

by legna_fg In reply to change color for a diasab ...

The question was auto-closed by TechRepublic

Collapse -

change color for a diasable field in acc

by vladm In reply to change color for a diasab ...

For change of color of Control on any condition, for example, accessible / inaccessible it is necessary to use change of properties Color and ForeColor on event OnRecord, which occurs with transition between records of a source of the given form, and also with opening the form.
If it is necessary to trace a condition of an element of management during manipulation with the form - use event AfterUpdate of appropriate Control.
These actions cannot be carried out, when the form is in a tape kind- viewing of several records simultaneously.

Collapse -

change color for a diasable field in acc

by legna_fg In reply to change color for a diasab ...

The question was auto-closed by TechRepublic

Collapse -

change color for a diasable field in acc

by donq In reply to change color for a diasab ...

If Me.[disabledFieldName].Disabled = "True" Then [disabledFieldName].Backcolor = 12632256 Else [disabledFieldName].Backcolor = 16777215 EndIf

I always call up the color box and paste the color # I want in the clipboard, then open my code snippet and copy the clipboard contents behind the equal sign. I use this inside GotFocus() and LostFocus() regularly to turn the field with focus background color to white, and then back to my Forms primary color so the user never has to hunt for a flashing cursor. Use any colors you want this way without screwing up??? Have fun Don Quigg

Collapse -

change color for a diasable field in acc

by legna_fg In reply to change color for a diasab ...

The question was auto-closed by TechRepublic

Back to Web Development Forum
11 total posts (Page 1 of 2)   01 | 02   Next

Software Forums