Il venerdì 17 aprile 2009 16:08:45 charlesg ha scritto:
> Hi all
>
> Having selected a gridview row with a click, I cannot deselect it with
> another click as should be normal.
>
> After reading an old thread here, I have fudged it with an array bSelected
> which keeps track of which rows in gvRequired are selected.
>
> '-------------------------------------------------------------
> PUBLIC SUB gvRequired_Click()
>   IF bSelected[gvRequired.Row] THEN
>     bSelected[gvRequired.row] = FALSE
>   ELSE
>     bSelected[gvRequired.row] = TRUE
>   ENDIF
>   txtItem.SetFocus
> END
> '-------------------------------------------------------------
> PUBLIC SUB gvRequired_LostFocus()
>     DIM x AS Integer
>
>     gvRequired.Rows.Unselect
>     FOR x = 0 TO gvRequired.Rows.count - 2
>         IF bSelected[x] THEN
>             gvRequired.Rows[x].Selected = TRUE
>         ENDIF
>     NEXT
> END
> '-------------------------------------------------------------
>
> This can't interpret shift+click and ctrl+click used to create the
> selection. How can I trap shift+click on a gridview?
>
> Or am I as usual making a whale of a gambas :)
>
> rgds

You could use the MouseDown event. Example:


PUBLIC SUB GridView1_MouseDown()

  IF Mouse.Shift THEN 
    PRINT "You clicked while pressing the Shift key"
  ENDIF   

END

Saluti,

Stefano

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to