4
Answers

Click Events on TableLayout

Volker Bruhn

Volker Bruhn

13y
13.6k
1
Hello,

I am going through some basics to create games like sudoku, kakuro and so on.
Before doing the algorithms I want the user interface to work fine.

For now I have a scalable TableLayout, the cells are filled with Panels (later on, these are filled with Labels).

The user is able to navigate through the cells using the arrow keys, and should be able to select a cell by clicking with the mouse on it.

Now here is my problem: I do not know which cell, panel, label has been clicked. The best I got, was getting the X,Y using a MouseClick-event.
As the TableLayout is very flexible, it is very ... hmmm ... unfunny ... to get the cell by calculating the coordinates.

Is there a way to get the Click-event to send the clicked origin?
I think that WPF does it, but I am not acquainted with it at all. So how can I do it on Windows Forms???

Regards,
Volker
Answers (4)