Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid splitbar question
Message
De
01/04/2004 04:46:25
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
31/03/2004 22:00:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00891356
Message ID:
00891389
Vues:
20
>as i move up and down the records in my grid using the arrow keys, i notice a small line above and below the selected cell. is this the split bar? however, this applies only to the selected cell. i want it as if i select a cell, the row from which it is on will also show.
>
>i have highlight row and highlight properties to .f.
>
>any help?

It's the backcolor of object behind grid (typically form.backcolor)
Use DynamicBackColor. ie:
Public oForm
oForm = Createobject('myForm')
m.oForm.Show

Define Class myForm As Form
  DataSession=2

  Add Object grdTest As HighLighted
  Procedure Load
  Use employee
Endproc
Enddefine
Define Class HighLighted As Grid
  Height = 200
  Width = 320
  ccurrecbackcolor = (Rgb(255,255,192))
  ccurrecforecolor = (Rgb(0,0,0))
  HighLightRow = .F.
  Highlight = .F.

  Protected lingrid
  lingrid = .T.
  ncurrec = .F.
  Name = "highlighted"
  *-- Refresh when recpointer moves. For calling outside of grid.
  Procedure recchange
  With This
    .ncurrec = Recno(.RecordSource)
    .Refresh
  Endwith
Endproc

*-- Sets dynamicbackcolors
  Procedure setdyncolors
  With This
    .SetAll("DynamicBackColor", "IIF(RecNo(This.RecordSource) = This.nCurRec," + ;
      str(.ccurrecbackcolor)+","+Str(.BackColor)+")", "Column")
    .SetAll("DynamicForeColor", "IIF(RecNo(This.RecordSource) = This.nCurRec," + ;
      str(.ccurrecforecolor)+","+Str(.ForeColor)+")", "Column")
    .SetAll("Sparse",.F.)
  Endwith
Endproc

  Procedure When
  This.lingrid = .T.
Endproc

  Procedure Valid
  This.lingrid = .F.
Endproc

  Procedure Init
  With This
    If !Empty(.RecordSource)
      .ncurrec = Recno(.RecordSource)
    EndIf
    Local loTextBox
    loTextbox = CreateObject('Textbox')
    .cCurrecBackColor = m.loTextBox.SelectedBackColor
    .cCurrecForeColor = m.loTextBox.SelectedForeColor
    .setdyncolors()
  Endwith
Endproc

  Procedure BeforeRowColChange
  Lparameters nColIndex
  Thisform.LockScreen = This.lingrid
Endproc

  Procedure AfterRowColChange
  Lparameters nColIndex
  With This
    .ncurrec = Recno(.RecordSource)
    Thisform.LockScreen = .F.
    If !.lingrid
      .Refresh()
    Endif
  Endwith
Endproc
Enddefine
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
Répondre
Fil
Voir

Click here to load this message in the networking platform