click handler for Button in TableLayoutPanel

  • Thread starter Thread starter swartzbill2000
  • Start date Start date
S

swartzbill2000

Hello,
I have an array of Buttons down a column of a TableLayoutPanel. They
all share a common click handler. In the handler, how can I determine
the row of the TableLayoutPanel for the Button that got clicked?
Bill
 
Hello,
I have an array of Buttons down a column of a TableLayoutPanel. They
all share a common click handler. In the handler, how can I determine
the row of the TableLayoutPanel for the Button that got clicked?
Bill

Check out the GetPositionFromControl method of the TableLayoutPanel.
 
Hello,
I have an array of Buttons down a column of a TableLayoutPanel. They
all share a common click handler. In the handler, how can I determine
the row of the TableLayoutPanel for the Button that got clicked?
Bill


In the handler, determine the Sender which exposes the control's Name,
Text and Tag properties (among others).

Dim WhichBtn As Button = DirectCast(sender, Button)
WhichBtn.Name
WhichBtn.Text
WhichBtn.Tag


Gene
 
Back
Top