Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to set grid column to Windows disabled color
Message
From
10/04/2009 00:03:37
 
 
To
09/04/2009 07:15:53
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01393891
Message ID:
01394089
Views:
180
Thank you. That is a simple and elegant way of doing it.

Alex

>>Hi,
>>
>>I'd like some grid columns to take on the "disabled" color from the scheme (theme?) the user has chosen at the Windows level, How do you do accomplish that?
>>
>>TIA,
>>
>>Alex
>
>You can use a temp textbox to get colors.
>
local o
>o = createobject('Textbox')
>lnBackColor = o.DisabledBackColor
>lnForeColor = o.DisabledForeColor
>
>Here is a sample:
>
>Public oForm
>oForm = Createobject('sampleForm')
>oForm.Show()
>
>Define Class sampleForm As Form
>  DataSession=2
>  Height=400
>  Width=800
>  Add Object myGrid As Grid With RecordSource='customer',Height=400,Width=800
>  Procedure Load
>    Use (_samples+'data\customer')
>  Endproc
>
>  Procedure Init
>    This.myGrid.Columns(1).Enabled = .F.
>    This.myGrid.Columns(4).Enabled = .F.
>    This.setGridDisabledColors(This.myGrid, '1,4,5') && need not be disabled really
>  Endproc
>
>  Procedure setGridDisabledColors(toGrid,tcColList)
>    Local Array aCols[1]
>    Local o,ix
>    o = Createobject('Textbox')
>    For ix = 1 To Alines(aCols,m.tcColList,1,',')
>      toGrid.Columns( Val(aCols[m.ix]) ).DynamicBackColor = Ltrim(Str(o.DisabledBackColor))
>      toGrid.Columns( Val(aCols[m.ix]) ).DynamicForeColor = Ltrim(Str(o.DisabledForeColor))
>    Endfor
>  Endproc
>Enddefine
>
Cetin
Previous
Reply
Map
View

Click here to load this message in the networking platform