Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid's tooltip
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01109969
Message ID:
01227427
Vues:
39
Ok, I wrote it while back (myself or with some help - don't remember):
procedure GetColumnIndex
	local lnI, lnIndex
	lnIndex=0
	with this.parent
		for lnI=1 to .parent.columncount
			if .parent.columns[m.lnI].columnorder=.columnorder
				lnIndex=m.lnI
				exit
			endif
		next
	endwith
	return m.lnIndex
>>Wow, that's way more code than what I've got. For now, I can live with the little quirk of moving the mouse cursor that I've got, but I will have to fix it at some point, so this may come in handy. Thanks.
>
>Hi Fred,
>
>I tried this code in my real application and it didn't work for me.
>
>This particular piece
>
>If This.oGridObj.GridHitTest (m.laTmp (3), m.laTmp (4), ;
>						@m.lnWhat, @m.lnRow, @m.lnCol)
>					If m.lnWhat = 3
>						lnCol = m.lnCol + This.oGridObj.LeftColumn - 1
>						If This.oGridObj.RelativeRow # 0
>							lnRow = m.lnRow - This.oGridObj.RelativeRow
>							If m.lnRow # 0
>								Skip m.lnRow In This.oGridObj.RecordSource
>								lcCaption = ;
>									TRANSFORM (Evaluate (This.oGridObj.Columns(m.lnCol).ControlSource))
>								Skip -m.lnRow In This.oGridObj.RecordSource
>							Else
>								lcCaption = ;
>									TRANSFORM (Evaluate (This.oGridObj.Columns(m.lnCol).ControlSource))
>							Endif
>						Else
>							Mouse Click Left
>							lcCaption = ;
>								TRANSFORM (Evaluate(This.oGridObj.Columns(m.lnCol).ControlSource))
>						Endif
>					Else
>						* We're not on the column with data	
>						*lcCaption = "Nothing to display"
>					Endif
>				Endif
>
>shows wrong information. The reason is that I re-arranged columns and added new columns when designed this form and the grid.
>
>So, the question is: how can we find out column's controlsource if we know the column order?
>
>Should be a simple fix.
>
>Thanks.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform