This can be a solution :
namespace WFRobotCar
{
Myrc array_rc;
private void Setvalue_Click(object sender, EventArgs e)
{
array_rc = new Myrc(Convert.ToInt32(this.XtextBox.Text), Convert.ToInt32(this.YtextBox.Text));
}
private void printrc_click(object sender, EventArgs e)
{
int i, j;
for (int i = 0; i < array_rc.GetLength(0); i++)
{
Console.Write(" ");
for (int j = 0; j < array_rc.GetLength(1); j++)
{
if ((i == int_current_row) && (j == int_current_col))
Console.ForegroundColor = ConsoleColor.Green;
if (array_rc[i, j])
{
Console.Write('-');
}
else
{
Console.Write('0');
}
if ((i == int_current_row) && (j == int_current_col))
Console.ResetColor();
}
Console.WriteLine();
}
}
}