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.

enter image description here


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -