INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Grids

How can I 'grey out' a grid? by ChrisRChamberlain
Posted: 26 Nov 03 (Edited 27 Nov 03)

If you want to disable and show a grid 'greyed out', the default .DisabledBackColor for a textbox is white, while you perhaps run an external application or something similar, try the following code.

The default .DisabledBackColor for a textbox is white
You will need to replace the various values with those relevant to your application.

You will also need to change the .DisabledBackColor property of any checkboxes you may have in a column(s) to say RGB(128,128,128) to prevent white showing as the background colour.

The example shows the selected row highlighted and these values will also need examining.

WITH THISFORM.Grid1
    .SetAll([BackColor],RGB(212,208,200),[Column])
    .SetAll([ForeColor],RGB(128,128,128),[Column])
    .SetAll([ForeColor],RGB(128,128,128),[Header])
    .SetAll([DynamicBackColor]    ,;
           "IIF(RECNO([TABLENAME]) = THISFORM.nRecNo    ,;
            RGB(212,208,200)    ,;
            RGB(212,208,200))"    ,;
            [Column])
    .SetAll([DynamicForeColor]    ,;        
           "IIF(RECNO([TABLENAME]) = THISFORM.nRecNo    ,;
            RGB(128,128,128)    ,;
            RGB(128,128,128))"    ,;
            [Column])
    .Enabled = .F.
    .Refresh()
ENDWITH

* Run other process and then enable grid

WITH THISFORM.Grid1
    .SetAll([BackColor],RGB(255,255,255),[Column])
    .SetAll([ForeColor],RGB(0,0,0),[Column])
    .SetAll([ForeColor],RGB(0,0,0),[Header])
       .SetAll([DynamicBackColor]    ,;
           "IIF(RECNO([TABLENAME]) = THISFORM.nRecNo    ,;
            RGB(10,36,106)        ,;
            RGB(255,255,255))"    ,;
            [Column])         
    .SetAll([DynamicForeColor]    ,;
           "IIF(RECNO([TABLENAME]) = THISFORM.nRecNo    ,;
            RGB(255,255,255)    ,;
            RGB(0,0,0))"        ,;
            [Column])
    .Enabled = .T.
    .Refresh()
ENDW

Have fun!

Back to Microsoft: Visual FoxPro FAQ Index
Back to Microsoft: Visual FoxPro Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close