Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Colors
Message
From
25/05/1999 02:07:54
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00222199
Message ID:
00222343
Views:
24
>VFP5, latest update...
>
>I have a grid, and the client wants 4 different colors to show status. This is no problem for unselected cells, using DynamicForeColor and DynamicBackColor with SetAll().
>
>However, whenever the client selects a cell the color changes to the textbox backcolor/forecolor. They want to have the color in the active cell match the inactive cell colors so ONLY the cursor shows which cell is active. Whenever I try an IIF() statement in the forecolor I get an error. Any ideas? Have I missed something obvious?
>
>Also, since the MUST select the cells even though they are read-only, I need to have the same colors showing on selected text.
>
>TIA
>Barbara
Hi Barbara,
Either set it in gotfocus :
*gotfocus
with this
 .SelectedBackColor = .backcolor
 .SelectedForeColor = .forecolor
endwith
or (sounds better) just do it once (referring to code) in grid.afterrowcolchange :
LPARAMETERS nColIndex
WITH this
  IF !empty(.Columns(nColIndex).dynamiccurrentcontrol)
    cCurrentControl = eval(.Columns(nColIndex).dynamiccurrentcontrol)
  ELSE
    cCurrentControl = .Columns(nColIndex).currentcontrol
  ENDIF
  lcBackColor = .Columns(nColIndex).DynamicBackColor
  lcForeColor = .Columns(nColIndex).DynamicForeColor
  IF pemstatus(evaluate(".Columns(nColIndex)."+cCurrentControl), "SelectedBackColor", 5)
    WITH evaluate(".Columns(nColIndex)."+cCurrentControl)
      .SelectedBackColor = iif(!empty(lcBackColor), eval(lcBackColor), .BackColor)
      .SelectedForeColor = iif(!empty(lcForeColor), eval(lcForeColor), .ForeColor)
    ENDWITH
  ENDIF
ENDWITH
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform