[Gambas-user] columnview

Fabien Bodard gambasfr at ...11...
Thu Aug 25 22:26:54 CEST 2005


Le Jeudi 25 Août 2005 02:33, John W. Rittinghouse a écrit :
> Hello all,
>
>
>         I have been trying to figure out how to select an item clicked
>         in the
>         column view code below.  I have no problem getting the value of
>         the row
>         selected, but how to i determine which of the three columns of
>         that
>         particular row has been clicked?  Any help would be appreciated.
>
>         regards,
>
>         JR

Columnview is not gridview

Fabien

>         -------------------------------------------------------------
>
>         ' Gambas class file
>
>         PUBLIC SUB Form_Open()
>            Form1.Caption = "  ColumnView Example  "
>         END
>
>         PUBLIC SUB _new()
>
>            DIM iwidth AS Integer
>            DIM irows AS Integer
>            DIM irowcounter AS Integer
>            DIM icolcounter AS Integer
>
>            ColumnView1.Columns.Count = 3
>            iwidth = ColumnView1.Width / ColumnView1.Columns.Count
>
>            ColumnView1.Columns[0].Width = iwidth
>            ColumnView1.Columns[0].Text="FirstCol"
>
>            ColumnView1.Columns[1].Width = iwidth
>            ColumnView1.Columns[1].Text="SecondCol"
>
>            ColumnView1.Columns[2].Width = iwidth
>            ColumnView1.Columns[2].Text="ThirdCol"
>
>            FOR irowcounter = 0 TO 4
>              ColumnView1.Add(irowcounter, icolcounter)
>              FOR icolcounter = 0 TO ColumnView1.Columns.Count - 1
>                ColumnView1[irowcounter][icolcounter] = "Col: " &
>         icolcounter & "
>         Row: " & irowcounter
>              NEXT
>            NEXT
>         END
>
>         PUBLIC SUB Button1_Click()
>            ME.Close
>         END
>
>         PUBLIC SUB Button2_Click()
>           ColumnView1.Clear
>         END
>
>         PUBLIC SUB Button3_Click()
>            _new
>         END





More information about the User mailing list