C# Create one Label filled with 2d string array -
im doing c# maze should fill screen like
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
the x's places randomly , mouse trying find way out. having trouble finding way fill x's. tried creating 2d string array full of x's , fill label, no luck.
what best way of doing this? using panel or maybe don't know about? have in wfa
same example other answer windows forms :) same.
public partial class form1 : form { public form1() { initializecomponent(); } private void panel1_paint(object sender, painteventargs e) { var blackpen = new pen(brushes.black); (int y = 0; y < 10; y++) { (int x = 0; x < 10; x++) { e.graphics.drawline(blackpen, new point(x*20, y*20), new point(x*20 + 10, y*20+10)); e.graphics.drawline(blackpen, new point(x*20, y*20+10), new point(x*20 + 10, y*20)); } } } }
you have add panel window (name panel1 if isn't yet) , event handler paint
nothing complicated.
Comments
Post a Comment