Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid control
Message
De
01/03/2002 04:38:10
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
01/03/2002 04:33:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00626852
Message ID:
00626857
Vues:
11
>Hi,
>
>I have a grid in a form that was split into two. The grid contains 5 columns all in all. Is it possible that the first split will start to display column 1 and the second split will start on column 2?
>
>the problem is everytime I run the form, both split starts at column 1. Is there a possible way to do this?
>
>Thanks in advance...

Create a form with a custom property named LockCount
This property would hold number of columns to lock on left
Add your grid and build as usual
Copy&paste the code below to their target methods
*Grid.Init
With this
  lnVertScrollWidth = iif(.ScrollBars < 2, 0, sysmetric(5) )
  lnRecAndDelMarkWidth = ( iif(.DeleteMark,0.6,0) + ;
    iif(.RecordMark,0.6,0) ) * lnVertScrollWidth
  lnGridLineWidth = iif(.GridLines < 2, 0, .GridLineWidth )
  lnTotWidth = 0
  For ix = 1 to thisform.lockcount
    lnTotWidth = lnTotWidth + .Columns(ix).Width + lnGridLineWidth
  Endfor
  .Partition = lnTotWidth + iif(.GridLines < 2, 4, .GridLineWidth ) + ;
    lnVertScrollWidth + ;
    max(lnRecAndDelMarkWidth, 1)
  .ActivateCell(1,thisform.lockcount+1) && Setfocus to 2nd panel
  Do while .LeftColumn<thisform.lockcount+1
    .DoScroll(5)    && Scroll right
  Enddo
Endwith

* Grid.BeforeRowColChange
Lparameters nColIndex
With this
  Do case
    Case inlist(lastkey(),9,4,2) && Right
      If .Panel = 0 and this.Columns(nColIndex).ColumnOrder = thisform.lockcount
        Nodefault
        .Columns(1).Setfocus()
        .Panel = 1
        .Columns(thisform.lockcount+1).Setfocus()
      Endif
      If .Panel = 1 and  .Columns(nColIndex).Columnorder=.ColumnCount
        Nodefault
        .Columns(thisform.lockcount+1).Setfocus()
        .Panel = 0
        .Columns(1).Setfocus()
      Endif
    Case inlist(lastkey(),15,19,26) && Left
      If .Panel = 0
        If .Columns(nColIndex).Columnorder=1
          Nodefault
          .Panel = 1
          .Columns(.Columncount).Setfocus()
        Endif
      Endif
      If .Panel = 1 and .Columns(nColIndex).Columnorder=thisform.lockcount+1
        Nodefault
        .Panel = 0
        .Columns(thisform.lockcount).Setfocus()
      Endif
    Otherwise
  Endcase
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform