click handler for Button in TableLayoutPanel

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
 
C

Chris Dunaway

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.
 
G

gene kelley

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top