Can't find what you're looking for?

Contact us or post in our forums and we'll help you find an answer.

Get the coordinates of a C1TileControl Tile with respect to the form

Background:

When you place a tile on the form it is placed inside the group. X and Y property of tile returns the coordinates of tile with respect to the parent group of that tile.

Steps to Complete:

To find the co-ordinates of the Tile with respect to the form, handle the Click event of the Tile as given in code snippet below:

int x_cor;
int y_cor;
private void tile_Click(object sender, EventArgs e)
{
  Tile myTile = (Tile)sender;
    if (myTile.Group!=null)
       {
         x_cor = myTile.X + myTile.Group.X;
        y_cor = myTile.Y + myTile.Group.Y;
        MessageBox.Show(string.Format("X:{0},Y:{1}", x_cor, y_cor));
       }
  }
Get the Latest Version of WinForms Edition
Download the Free Trial Now