Hallo ,
ich habe ein Problem mit dem einem Label in meinem Spiel, ich habe eine klase welche so ausschaut :
|
C#-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing;
namespace Weed_The_Game
{
class Dev_progress
{
//Das label, welches die version anzeigt
public Label versionsLabel = new Label()
{
Location = new Point(5,10),
Text = "Version : 0.0.1.0",
ForeColor = Color.Black,
BackColor = Color.Transparent,
};
//Ein label,welche die frühe version darstellt
public Label unfertig_Label = new Label()
{
Location = new Point(5, 20),
Text = "Map´s , Player , Gameplay NOT Final , Only for demo Star Auditions purposes",
ForeColor = Color.Black,
BackColor = Color.Transparent,
};
}
}
|
und Diesen Code habe ich in dem Form,in welchem die Label angezeigt werden sollen :
|
C#-Quelltext
|
1
2
3
|
Dev_progress Dev_Infos = new Dev_progress();
this.Controls.Add(Dev_Infos.versionsLabel);
this.Controls.Add(Dev_Infos.unfertig_Label);
|
Allerdings kommt auf dem Form nur Folgendes zustande :