Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Double-Click in Grid Textbox
Message
De
09/06/2010 18:24:03
Scott Butts
Ims Specialty Services
Twin Falls, Idaho, États-Unis
 
 
À
09/06/2010 18:05:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01468179
Message ID:
01468185
Vues:
51
>>>I'm pretty sure I'll feel silly when this is explained but.........
>>>
>>>I've put a Grid control on a form.
>>>
>>>When the user dbl-clicks on a cell in the first column, I want something to happen. For testing purposes, it's just to pop up a messagebox. So in MyGrid.Column1.Text1.dblclick I put in MESSAGEBOX("dbl click")
>>>
>>>When the user dbl-clicks, nothing happens. I put a Messagebox in
>>> myGrid.click
>>> myGrid.column1.text1.click
>>>
>>>but none of them seem to activate either. What am I overlooking???????
>>>
>>>Thanks to all...........Rich
>>
>>Do you have the property AllowCellSelection to False?
>>
>>When that property is false, only Grid events are raised. You can put your code in grids dblclick event then
>
>I tried it and can now get to the grid's events. I'm not sure how useful it will be however. I want to do something only if the dbl-click was in column1 (and eventually do other things when things happen in other columns. I don't see how to find out which column I'm in (grid.activecolumn = 0 at this point)
>
>Even worse, this prevents my users from navigating in the grid to get to columns past the visible display.
>
>So thanks for the attempt. Any other ideas?

Here is some code that I have in on of my grids right click event, it works for me. Hope this helps.
AMOUSEOBJ(aMouseInfo,1)						&& Get the location of the mouse
STORE 0 TO lnWhere, lnRelRow, lnRelCol				&& Ask Grid if click was on it
THISFORM.grdApptsView.GRIDHITTEST(aMouseInfo[3],aMouseInfo[4],@lnWhere,@lnRelRow,@lnRelCol)
IF (!lnWhere = 3)						&& Click NOT of grid, abort
	RETURN .F.
ENDIF

THIS.ACTIVATECELL(lnRelRow,lnRelCol)				&& Activate the grids cell that is being
lnColumn 	= THIS.ACTIVECOLUMN				&& right clicked on so activecolumn is valid
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform