How to get the Grid.Row Grid.Column from the selected added control?
How to get the Grid.Row Grid.Column from the added 开发者_运维百科control?
Basically I have 16 grids with 4 rows and 4 columns, each grid is added a round button.
how to determine which rows and columns the selected round buttons are located respectively in the below MouseEventHandler of mouseover? For mouseclick, there is only round button selected, but for mouseover, there would be a collection of buttons.
RoundButton_MouseEnter, RoundButton_MouseLeave, RoundButton_MouseDown, RoundButton_MouseUp
Thanks
You can use Grid.GetColumn(FrameworkElement element)
and Grid.GetRow(FrameworkElement element)
to find out what row and column an element has been set to. In XAML, Grid.Row="4"
is just sugar for Grid.SetRow(element, 4)
精彩评论