Hallo,
Ik ben bezig met een klein studie projectje.
Nu heb ik het probleem dat een arraylist van PictureBoxes die ik op het form wil tekenen.
Dit is de code waar ik het in de array zet:
Ik heb vanalles al geprobeerdt, die ook in het commentaar. Maar dit werkte niet. Wat ik dus nu wil is de picture boxes getekend op het form. Hoe ga ik dit aanpakken?
Ik ben bezig met een klein studie projectje.
Nu heb ik het probleem dat een arraylist van PictureBoxes die ik op het form wil tekenen.
Dit is de code waar ik het in de array zet:
C#:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| private void DrawBuildings() { this.BuildingList = new PictureBox[this.GameHandle.Buildings.Count]; for (int i = 0; i < this.GameHandle.Buildings.Count; i++) { this.BuildingList[i] = new PictureBox(); this.BuildingList[i].BackColor = Color.Black; this.BuildingList[i].Top = this.Height - this.GameHandle.Buildings[i].Height; this.BuildingList[i].Left = this.GameHandle.Buildings[i].xCord; this.BuildingList[i].Width = this.GameHandle.Buildings[i].Width; //waarde zijn toegekent, bij de controls op het form zetten. //this.components.Add(this.BuildingList[i], "Building_" + i.ToString()); } } |
Ik heb vanalles al geprobeerdt, die ook in het commentaar. Maar dit werkte niet. Wat ik dus nu wil is de picture boxes getekend op het form. Hoe ga ik dit aanpakken?