B4A Library My Grid Class

Hello,
I have received tons of help from people on this forum. Here is something I put together – I hope others find it useful in some way.

This is a class that implements a Grid. I implemented the grid by overlaying labels on a panel. Each label represents a cell giving each cell a click event. I also passed parameters to the grid.initialize using a parameter map. The grid is implemented as a B4A class. Source code and a test project are included in the zip.

Barry.
 

Attachments

  • GridClass.zip
    7.3 KB · Views: 533
  • SSVibrant.png
    SSVibrant.png
    24.5 KB · Views: 940

Mahares

Expert
Licensed User
Longtime User
In the CRGrid class module, I added a line in the cell _click sub. See below:
B4X:
Sub cell_click
  Dim i, r, c As Int
  Dim s As String
  Dim lb As Label
  lb = Sender
  lb.Color=Colors.Red   :lb.TextColor=Colors.white :lb.Text="TEST"
  CallSub2(Main, clicksub, lb)
End Sub
 

COBRASoft

Active Member
Licensed User
Longtime User
Without checking your code or class, I once made a grid using a module, perhaps there are some things in there you can use in yours. The code is available on this forum and is free :)
 

sanjibnanda

Active Member
Licensed User
Longtime User
CR grid cell color

In the CRGrid class module, I added a line in the cell _click sub. See below:
B4X:
Sub cell_click
  Dim i, r, c As Int
  Dim s As String
  Dim lb As Label
  lb = Sender
  lb.Color=Colors.Red   :lb.TextColor=Colors.white :lb.Text="TEST"
  CallSub2(Main, clicksub, lb)
End Sub

wow!!!, worked like a charm....thanx too much
 

sanjibnanda

Active Member
Licensed User
Longtime User
CR grid cell color chage after hitme button

Without checking your code or class, I once made a grid using a module, perhaps there are some things in there you can use in yours. The code is available on this forum and is free :)

sir,
the cell click works fine, but how i could change the colors of some selective cells after clicking hit-me button ...

kind regards,
sanjib
 
Top