Advertisement
Yo_Mb

Yo_21Mb

Oct 30th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. static class Program
  2. {
  3. public static Form1 form1;
  4. /// <summary>
  5. /// The main entry point for the application.
  6. /// </summary>
  7. [STAThread]
  8. static void Main()
  9. {
  10. Application.EnableVisualStyles();
  11. Application.SetCompatibleTextRenderingDefault(false);
  12. form1 = new Form1();
  13. Application.Run( form1);
  14. }
  15.  
  16. and
  17.  
  18. public Map(int map_x, int map_y, int map_tile_size)
  19. {
  20. this.map_map = new int[map_x, map_y];
  21. for (int i = 0; i < map_map.GetLength(0); i++)
  22. {
  23. for (int j = 0; j < map_map.GetLength(1); j++)
  24. {
  25. tile[i, j] = new PictureBox();
  26. tile[i, j].BackColor = System.Drawing.Color.Red;
  27. tile[i, j].Image = System.Drawing.Image.FromFile("../../Screenshot (189).png");
  28. tile[i, j].Location = new Point((i * map_tile_size) , (j * map_tile_size));
  29. tile[i, j].Size = new Size(map_tile_size, map_tile_size);
  30. tile[i, j].SizeMode = PictureBoxSizeMode.StretchImage;
  31. tile[i, j].Show();
  32. Program.form1.Controls.Add(tile[i, j]); <= THIS ONE HERE IWAS DOING ANNOYING
  33. Console.WriteLine(i + " " + j);
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement