Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid moving up at end
Message
De
15/03/2006 15:58:05
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Divers
Thread ID:
01104678
Message ID:
01104689
Vues:
14
>>I know this has been asked but can't find the answer. If I have a grid that fits the records perfectly when I get to the bottom of the grid I don't want it to move up the records and show an empty one at the bottom. Is there a way to change that?
>
>May be you should not use scroll bars then?

If you would like to see what I'm talking about here's the code. Just arrow down to the last row and hit the down arrow.
CREATE CURSOR ac_grid (col1 N(1), col2 N(1), col3 N(1), col4 N(1), ;
                       col5 N(1), col6 N(1), col7 N(1), col8 N(1), col9 N(1))
FOR ln_cntr = 1 TO 9
   APPEND BLANK
ENDFOR
LOCATE

RELEASE lo_form
PUBLIC lo_form
lo_form = NEWOBJECT('Form')
WITH lo_form
   .AddObject('grd_cells','grid')
   WITH .grd_cells
      .ScrollBars = 0
      .RecordMark = .f.
      .PanelLink  = .f.
      .DeleteMark = .F.
      .AllowRowSizing    = .f.
      .AllowHeaderSizing = .f.
      .RecordSourceType = 1
      .RecordSource = "ac_grid"
      .HeaderHeight = 0
      .RowHeight = .RowHeight * 2
      .SetAll('Width', .RowHeight , 'Column')
      .SetAll('Alignment', 2, 'TextBox')
      .SetAll('Alignment', 2, 'Column')
      .Top         = 0
      .Left        = 0
      .Width       = (.RowHeight + .GridLineWidth) * 9
      .Height      = .Width
      .ColumnCount = 9
      .LockColumns = 9
      FOR ln_cntr = 1 TO 9
         WITH .Columns(ln_cntr)
            .ControlSource = "col" + PADL(ln_cntr, 1)
            DO CASE
               CASE ln_cntr < 4
                 .DynamicBackColor = "IIF(RECNO() < 4, RGB(255, 128, 128), " + ;
                                     "IIF(RECNO() < 7, RGB(255, 255, 128), " + ;
                                                      "RGB(128, 128, 255)))"
               CASE ln_cntr < 7
                 .DynamicBackColor = "IIF(RECNO() < 4, RGB(255, 128, 0), " + ;
                                     "IIF(RECNO() < 7, RGB(255, 0, 128), " + ;
                                                      "RGB(255, 255, 0)))"
               OTHERWISE
                 .DynamicBackColor = "IIF(RECNO() < 4, RGB(255, 128, 255), " + ;
                                     "IIF(RECNO() < 7, RGB(128, 0, 255), " + ;
                                                      "RGB(0, 255, 0)))"
            ENDCASE
         ENDWITH
      ENDFOR
      .Visible     = .t.
   ENDWITH
   .Width = .grd_cells.Width
   .Height = .grd_cells.Height
   .Show()
ENDWITH
Charles

"The code knows no master." - Chuck Mautz
"Everybody is ignorant, only on different subjects." - Will Rogers
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform