[Gambas-user] GridView Cell Height with WordWrap

Gianluigi bagonergi at gmail.com
Thu Feb 25 15:57:31 CET 2021


So if i understand well the code that i suggested you have not tried it.

Then try this [0]:

Regards
Gianluigi

[0]

Private $sText1 As String = "Nel mezzo del cammin di nostra vita mi
ritrovai in una selva oscura"
Private $sText2 As String = "Pippo"
Private $iNumber As New Integer[]

Public Sub Form_Open()

  With GridView1
    .Header = 3
    .Columns.Count = 2
    .Columns.Width = 100
    .Rows.Count = 100
  End With
  For r As Integer = 0 To GridView1.Rows.Max
    For c As Integer = 0 To GridView1.Columns.Max
      If GridView1[r, c].WordWrap Then GridView1.Rows[r].Height = -1
    Next
  Next

End

Public Sub GridView1_Data(Row As Integer, Column As Integer)

  If Row Mod 2 = 0 Then
    GridView1.Data.Text = $sText2
    GridView1.Data.Background = &HBFFFBF
  Else
    GridView1.Data.WordWrap = True
    GridView1.Data.Text = $sText1
  Endif

End
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210225/04aa63b3/attachment.htm>


More information about the User mailing list