Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Gridhighlighter Colors
Message
De
08/09/2005 18:23:29
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01047761
Message ID:
01047907
Vues:
14
This message has been marked as the solution to the initial question of the thread.
Colin,
My guess is that it's about English:) Could you be that I wrote it as GimmeColor and you created your method as GimmeColour?
Public oForm
oForm = Createobject('myForm')
oForm.Show

Define Class myForm As Form
  DataSession=2
  Height = 450

  Add Object myGrid As Grid With Height = 450

  Procedure Load
    Create Cursor manifest (Status c(1), myField i)
    For ix=1 To 20
      Insert Into manifest Values (Chr(Asc('A')+Int(Rand()*5)),m.ix)
    Endfor
    Locate
  Endproc

  Procedure GimmeColour
    Lparameters tcValue
    Do Case
      Case m.tcValue = 'A'
        Return 0xFF0000
      Case m.tcValue = 'B'
        Return 0x00FF00
      Case m.tcValue = 'C'
        Return 0x0000FF
      Otherwise
        Return 0xFFFFFF
    Endcase
  Endproc

  Procedure Init
    This.myGrid.SetAll('DynamicBackColor','(thisform.GimmeColour(manifest.status))')
  Endproc
Enddefine
Cetin

>Cetin
>
>I have put the first line ie
>
>thisform.grid1.Setall('DynamicBackColor','(thisform.GimmeColor(manifest.status))') in form init
>
>The rest of your code I have out in a new form method called GimmeColor
>
>I get invalid dynamicbackcolour expression
>
>What have i done wrong?
>
>Colin
>
>>>I have tried multiple colors in a grid before but so far have not cracked it even with help from the experts
>>>
>>>Let me try again
>>>
>>>I have a table called manifest which has a field called status
>>>
>>>If status is A I want to color the row blue
>>>If B the row will be red
>>>If C the row will be green
>>>
>>>How do I do it?
>>>
>>>A real layman's explanation would be greatly appreciated
>>>
>>>Thanks
>>>
>>>Colin Northway
>>
>>
>>* Anywhere you want to set dynamic coloring - ie: form init
>>thisform.myGrid.Setall('DynamicBackColor','(thisform.GimmeColor(manifest.status))')
>>
>>*Form custom GimmeColor
>>lparameters tcValue
>>do case
>>case m.tcValue = 'A'
>> return 0xFF0000
>>case m.tcValue = 'B'
>> return 0x00FF00
>>case m.tcValue = 'C'
>> return 0x0000FF
>>otherwise
>> return 0xFFFFFF
>>endcase
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform