[Gambas-user] Upper left cell in a TableView

Fabien Bodard gambas.fr at ...626...
Mon Aug 8 19:08:38 CEST 2016


This is how to do :-)

' Gambas class file


Public Sub Form_Open()

  TableView1.Rows.Count = 10
  TableView1.Columns.Count = 6

End

Public Sub TableView1_Draw(X As Integer, Y As Integer, Width As
Integer, Height As Integer, Row As Integer, Column As Integer)

  If Row = 0 And If Column = 0 Then    'Limit the drawing to one time
(even if the event is called for each existing cells)
    Paint.Save                      'Save the clip stack
    Paint.ResetClip                 'Reset the cliping region
    Paint.Brush = Paint.Color(Color.Black)  'Select the text color
    Paint.ClipRect = Rect(0, 0, TableView1.Rows.W,
TableView1.Columns.H) 'set the clippin region to the upper left cells
size
    Paint.Text("toto", 0, 0, TableView1.Rows.W, TableView1.Columns.H,
Align.Center) 'Draw the text path
    Paint.Fill   'Fill the text with color
    Paint.Restore   'Restore the clipping area
  Endif

End




More information about the User mailing list