Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MoverBar in Grid controls
Message
De
06/06/2003 08:21:18
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00797145
Message ID:
00797153
Vues:
19
>Hi Everybody,
>
>Please give me a clue how to create a MoverBar in a grid control?
>
>Thank you,
>Ali

This could be a clue I think :
oForm=createobject('form1')
oForm.Show
Read events

Define CLASS form1 AS form
  DataSession = 2
  Top = 0
  Left = 0
  Height = 215
  Width = 457
  DoCreate = .T.
  Caption = "Form1"
  Name = "Form1"

  Add OBJECT command1 AS commandbutton WITH ;
    Top = 36, ;
    Left = 360, ;
    Height = 27, ;
    Width = 84, ;
    Caption = "Down", ;
    Name = "Command1"

  Add OBJECT command2 AS commandbutton WITH ;
    Top = 72, ;
    Left = 360, ;
    Height = 27, ;
    Width = 84, ;
    Caption = "Up", ;
    Name = "Command2"

  Procedure Init
    This.Addobject('grdemployee','grid')
    With this.grdEmployee
      .RecordSource = "crsTest"
      .Visible = .t.
    Endwith
  Endproc

  Procedure Load
    Select  *, 0x7FFFFFFF as sorter from employee order by last_name into cursor crs1 nofilter
    Use dbf('crs1') in 0 again alias 'crsTest'
    Use in 'crs1'
    Use in 'employee'
    Select crsTest
    Replace all sorter with recno()
    Index on sorter tag sorter
  Endproc

  Procedure QueryUnload
    Clear events
  Endproc

  Procedure command1.Click
    If sorter=reccount()
      Return
    Endif
    With ThisForm.grdEmployee
      lnRec = recno(.recordsource)
      Skip in (.recordsource)
      Replace sorter with sorter-1 in .RecordSource
      Go lnRec
      Replace sorter with sorter+1 in .RecordSource
      lnSorter = eval(.RecordSource+'.sorter')
      Thisform.lockscreen = .t.
      Locate
      .refresh
      =seek(lnSorter, .RecordSource, 'sorter')
      .Refresh
      Thisform.lockscreen = .f.
    Endwith
  Endproc

  Procedure command2.Click
    If sorter<=1
      Return
    Endif
    With ThisForm.grdEmployee
      lnRec = recno(.recordsource)
      Skip - 1 in (.recordsource)
      Replace sorter with sorter+1 in .RecordSource
      Go lnRec
      Replace sorter with sorter-1 in .RecordSource
      .Refresh
    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