Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I lock a column in a grid
Message
 
À
03/05/2000 19:57:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00365799
Message ID:
00365896
Vues:
13
Thanks, Mike. I see from your code that performing this simple BROWSE function is not as easy with grids. I ran your sample and it works, so I'll bang around with it for a while to see if it works well for my specific purpose.


>>Can anyone tell me how to lock a column in a grid so it doesn't scroll out of view when I SetFocus to another column? I'm familiar with the FPW BROSE LOCK.. syntax but don't know how to do it in VFP Grids.
>
>AFAIK, Its not very easy, here's one way to go about it:
>
>
oForm = createobject('oMyForm')
>oForm.show(1)
>
>define class oMyForm as form
>	width = 500
>
>	add object oBottomGrid as oMyBottomGrid with ;
>		top = 25, ;
>		left = 25, ;
>		width = 420
>
>	add object oTopGrid as oMyTopGrid with ;
>		top = 25, ;
>		left = 25, ;
>		width = 197, ;
>		height = 180, ;
>		scrollbars = 0
>
>	add object oPaintForm as oMyTimer
>
>	proc init
>		lockscreen = .t.
>		this.oBottomGrid.doscroll(5)
>		this.oBottomGrid.doscroll(4)
>		lockscreen = .f.
>		this.refresh
>		this.click
>	endproc
>enddefine
>
>define class oMyBottomGrid as grid
>	recordsource = 'labels.dbf'
>	recordsourcetype = 0
>
>	proc scrolled
>		lparameters nDirection
>		thisform.lockscreen = .f.
>		thisform.oTopGrid.zorder(0)
>		thisform.lockscreen = .t.
>		thisform.paint
>		thisform.refresh
>	endproc
>
>	proc init
>		this.setall('Width', 50, 'Column')
>	endproc
>enddefine
>
>define class oMyTopGrid as grid
>	recordsource = 'labels.dbf'
>	recordsourcetype = 0
>
>	proc init
>		this.setall('Width', 50, 'Column')
>	endproc
>enddefine
>
>define class oMyTimer as timer
>	interval = 100
>
>	proc timer
>		thisform.lockscreen = .f.
>		this.enabled = .f.
>	endproc
>enddefine
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform