This is good: http://img839.images...4120/goodzj.png
This is bad: http://img267.images...7/9770/badz.png
And this is my code:
n = GV.a[0].GetUpperBound(0) + 1;
m = GV.a[0].GetUpperBound(1) + 1;
label1.Location = new Point(this.Width / 2 - label1.Text.Length * 4, label1.Location.Y);
int width = this.Width / 2 + m * 8;
int height = label1.Location.Y + 20;
string text, space = " ";
for (int i = 0; i < n; ++i)
{
text = string.Empty;
for (int j = 0; j < m; ++j)
{
text += GV.a[type][i, j].ToString() + space;
text = text.PadRight(10 - (GV.a[type][i, j].ToString().Length * 2));
}
Label val = new Label();
val.AutoSize = true;
val.Location = new Point(width / 2, height);
val.Text = text;
this.Controls.Add(val);
height += 20;
}

New Topic/Question
Reply




MultiQuote



|