It is because your break Exits the "While Loop" not the for loop...and im guessing your while loop only executes once? Why do you need while for that? Try this
for (i = 0; i < time;i++ )
{
DragonBoard.Write("w");//go forward
if (int.Parse(bearingTxt.Text) - 1 > heading)
{
DragonBoard.Write("a");//turn left
break;
}
else (int.Parse(bearingTxt.Text) +1 < heading)
{
DragonBoard.Write("d");//turn right
break;
}
}