フォームにテキストを書き込むためのラベルを作成するプログラムを書いていましたが、何とか重要なクラスを破壊した後、最初からやり直しました...もうラベルを印刷することはできないようですが、単に印刷しません.表示されません。
public partial class Form1 : Form
{
static Form FormX = new Form();
public Form1()
{
Shown += new EventHandler(FormX_Shown);
InitializeComponent();
}
public void FormX_Shown(object sender, EventArgs e)
{
WriteTextOnScreen("Hello!");
}
public void WriteTextOnScreen(string text)
{
Label tempLabel = new Label();
tempLabel.Text = text;
tempLabel.Name = "";
tempLabel.Location = new Point(10, 10);
FormX.Controls.Add(tempLabel);
}
}
何が問題なのかわかりませんが、私は自分でそれを修正するほど賢くないので、今では信じられないほど厄介になっています:-P