[Gambas-user] columnview

John W. Rittinghouse jr at ...1090...
Thu Aug 25 02:33:46 CEST 2005


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
        -------------------------------------------------------------
        
        ' 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
        
        
        
        
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20050824/5599919c/attachment.html>


More information about the User mailing list