General discussion

  • Creator
    Topic
  • #2083015

    change color for a diasable field in acc

    Locked

    by legna_fg ·

    How can I change the disabled field colors?

All Comments

  • Author
    Replies
    • #3900577

      change color for a diasable field in acc

      by ash_syed ·

      In reply to change color for a diasable field in acc

      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

    • #3900537

      change color for a diasable field in acc

      by ghartlieb ·

      In reply to change color for a diasable field in acc

      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.

    • #3900494

      change color for a diasable field in acc

      by ghartlieb ·

      In reply to change color for a diasable field in acc

      A correction to my previous answer:

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

    • #3899263

      change color for a diasable field in acc

      by vladm ·

      In reply to change color for a diasable field in acc

      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.

    • #3892672

      change color for a diasable field in acc

      by donq ·

      In reply to change color for a diasable field in acc

      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

    • #3739790

      change color for a diasable field in acc

      by legna_fg ·

      In reply to change color for a diasable field in acc

      This question was auto closed due to inactivity

Viewing 5 reply threads