0を16x9個とcanの値の0を表示したいのですが トップレベルのコントロールをコントロールに追加できません。と this.Parent = fcan;の表示されてしまいます。
using System;
using System.Drawing;
using System.Windows.Forms;
class Sample5 : Form
{
private static Label[][] lb;private static Label fcan;
private static string[] wine; private static int can;
public static void Main()
{
Application.Run(new Sample5());
}
public Sample5()
{
this.Text = "テトリス";
wine = new string[2];
wine[0] = "0"; wine[1] = "1";
lb = new Label[18][];
for (int i5 = 0; i5 <= 10; i5++) { lb[i5] = new Label[18]; } for (int i3 = 0; i3 <= 16; i3++) { for (int i4 = 0; i4 <= 9; i4++) { lb[i4][i3] = new Label(); lb[i4][i3].Parent = this; lb[i4][i3].Width = 7; lb[i4][i3].Height = 10; lb[i4][i3].Left = 8* i4; lb[i4][i3].Top = 10* i3; lb[i4][i3].Text = String.Format(wine[0]); } } fcan = new Label(); this.Parent = fcan; fcan.Width = 7; fcan.Height = 10; fcan.Left = 500; fcan.Top = 100; fcan.Text = can.ToString(); }
}

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。