Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Programmatically
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00293493
Message ID:
00293527
Vues:
27
Hi Alan,

>I'm sure there is a better way to do this.

I sent you an email on with the VCX's and an SCX to show it. For everyone else, here is the code for the VCX (Just make sure there is an selected alias):
**************************************************
*-- Class Library:  c:\vfptest\grids.vcx
**************************************************


**************************************************
*-- Class:        mygrid (c:\vfptest\grids.vcx)
*-- ParentClass:  grid
*-- BaseClass:    grid
*-- Time Stamp:   11/20/99 04:17:05 PM
*
DEFINE CLASS mygrid AS grid


	Height = 200
	Width = 320
	&&ncolumncount = 1  You can get rid of this property
	Name = "mygrid"


	PROCEDURE Init
		local lnI, lcColumn
		with this
			.ColumnCount = 0
			*for lnI = 1 to .nColumnCount
			for lnI = 1 to fcount() && I changed this line
				.AddColumn()
				.Columns[lnI].Name = 'Column'+allt(str(lnI))
				.Columns[lnI].ControlSource = field(lnI)
				.Columns[lnI].RemoveObject('Text1')
				.Columns[lnI].AddObject('MyText1', 'MyTextBox')
				.Columns[lnI].MyText1.Visible = .T.
				*.Columns[lnI].CurrentControl = 'MyText1'
			endfor
			thisform.Refresh
		endwith
	ENDPROC


ENDDEFINE
*
*-- EndDefine: mygrid
**************************************************


**************************************************
*-- Class:        mytextbox (c:\vfptest\grids.vcx)
*-- ParentClass:  textbox
*-- BaseClass:    textbox
*-- Time Stamp:   11/20/99 04:09:10 PM
*
DEFINE CLASS mytextbox AS textbox


	Name = "mytextbox"


	PROCEDURE DblClick
		this.parent.parent.DblClick()
	ENDPROC


ENDDEFINE
*
*-- EndDefine: mytextbox
**************************************************
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform