<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 2 Mar 2023 at 16:08, Mayost Sharon <<a href="mailto:sharon@455.co.il">sharon@455.co.il</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello<br>
<br>
I know it's just for show<br>
but<br>
While I fill the cell with the button<br>
data.control=WebButton<br>
So when I click on the button that is in a certain cell I get an event of:<br>
WebTable1_Click(Row As Integer, Column As Integer)<br>
Then I can know from which row and which column the button is pressed<br>
And it provides me with information on how to access a database to retrieve the information I nee<span class="gmail_default" style="font-size:small">d</span></blockquote><div><br></div><div style="font-size:small" class="gmail_default">showing the button text in the example code we have been using the text showed <br></div><div style="font-size:small" class="gmail_default">Button:1_1 for row 1 column 1</div><div style="font-size:small" class="gmail_default"><div style="font-size:small" class="gmail_default">Button:2_1 for row 2 column 1</div><div style="font-size:small" class="gmail_default"><br></div><div style="font-size:small" class="gmail_default">(there is row/col identity there)<br></div><div style="font-size:small" class="gmail_default"><br></div></div>You can also use the button.Name <span class="gmail_default" style="font-size:small">to give a unique name stating Row/column while having same button text on all buttons.</span><br><div style="font-size:small" class="gmail_default"><br></div><div style="font-size:small" class="gmail_default">Also button.Tag</div><div style="font-size:small" class="gmail_default"><br></div><div style="font-size:small" class="gmail_default">So of course you can tell what button was clicked from what row./col, <br></div><div style="font-size:small" class="gmail_default">by smart naming as your code has done all along..<br></div><div style="font-size:small" class="gmail_default"><br></div><div style="font-size:small" class="gmail_default">Public Sub WebTable1_Data(Row As Integer, Column As Integer, Data As WebTableData)<br><br> Select Case Column<br>  Â  Case 0<br>  Â  Â  Data.Background = Color.SetAlpha(Color.Yellow, 192)<br>  Â  Â  Data.Text = "Data: " & CString(Row) & "_" & CString(Column)<br>  Â  Case 1<br>  Â  Â  Dim wb As WebButton = New WebButton(Me) As "BUT"<br>  Â  Â  wb.Text = "DangerButton"</div><div style="font-size:small" class="gmail_default">     wb.Name =  "btnDanger_" & CString(Row) & "_" & CString(Column) </div><div style="font-size:small" class="gmail_default">  Â  Â  wb.Class = "button is-danger"<br>  Â  Â  Data.Control = wb<br>  End Select<br><br>End</div><div style="font-size:small" class="gmail_default"><br></div><div style="font-size:small" class="gmail_default">Public Sub BUT_Click()</div><div style="font-size:small" class="gmail_default"><br></div><div style="font-size:small" class="gmail_default">  Dim iRow, iCol as Integer</div><div style="font-size:small" class="gmail_default">  iRow = Split(Last.Text, "_")[1]<br></div><div style="font-size:small" class="gmail_default"><div style="font-size:small" class="gmail_default">  iCol = Split(Last.Text, "_")[2]<br></div><div style="font-size:small" class="gmail_default"><br></div></div><div style="font-size:small" class="gmail_default">End</div><div style="font-size:small" class="gmail_default"><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
The problem is that it only works with a button<br>
If I fill the cell with a check box<br>
It does not respond to a click event<br></blockquote><div><br></div><span class="gmail_default" style="font-size:small"></span></div><div style="font-size:small" class="gmail_default">Oh it has lots of problems if you want to make it do more than it has been designed for.</div><div style="font-size:small" class="gmail_default"></div><div style="font-size:small" class="gmail_default">I don't get why you even need it as there are plenty of ways to keep track of the buttons row/col data. As mentioned above.</div><div style="font-size:small" class="gmail_default"><br></div><div style="font-size:small" class="gmail_default"><br></div></div>