private void HighLightWord(GridWord word) { int rowChange = getRowChange(word.Direction); int columnChange = getColumnChange(word.Direction); for (int i = 0; i < word.Length; i++) { dataGridView1.Rows[word.Row + (rowChange * i)].Cells[word.Column + (columnChange * i)].Style.BackColor = Color.LightGreen; } }
private bool CheckHighlight(GridWord word) { int rowChange = getRowChange(word.Direction); int columnChange = getColumnChange(word.Direction); for (int i = 0; i < word.Length; i++) { if (!dataGridView1.Rows[word.Row + (rowChange * i)].Cells[word.Column + (columnChange * i)].Selected) { return(false); } } return(true); }