[Gambas-user] Howto somewhat thicker GridView lines

Gianluigi bagonergi at gmail.com
Mon Aug 10 19:48:12 CEST 2020


Il giorno lun 10 ago 2020 alle ore 19:12 Rolf-Werner Eilert <
rwe-sse at osnanet.de> ha scritto:

> Just looked for a way to make some (not all) of the lines of a GridView
> somewhat thicker, for instance every second line or something like the
> line between Row 2 + 3 and Row 4 + 5.
>
> Is there a way to achieve that?
>

You could do something like this (you can change the border as you want):

Public Sub Form_Open()

  Dim b As New
Border("style:none;right-style:solid;bottom-style:solid;left-style:solid;top-style:solid;color:orange;width:2;")
  Dim hCont As Control

  With GridView1
    .Header = 3
    .Columns.Count = 4
    .Columns.Width = 120
    .Columns[0].Text = "ID"
    .Columns[1].Text = "NAME"
    .Columns[2].Text = "SURNAME"
    .Columns[3].Text = "DATE"
    .Rows.Count = 10
  End With
  For r As Integer = 0 To GridView1.Rows.Max
    If r Mod 2 = 0 Then GridView1.Rows[r].Border = b
  Next

End

But if to load the data you use the _Data event (commanded by
GridView1.Rows.Count) then you could remove the For loop from Open and
insert this code inside Public Sub GridView1_Data (Row As Integer, Column
As Integer):

  Dim b As New
Border("style:none;right-style:solid;bottom-style:solid;left-style:solid;top-style:solid;color:orange;width:2;")

  If Row Mod 2 = 0 Then GridView1.Rows[Row].Border = b

Regards
Gianluigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200810/0f74a360/attachment.html>


More information about the User mailing list