0
Reply

Tab page not responding

Vashishtha

Vashishtha

Sep 29 2008 5:35 AM
2.3k
Everything happens OKEY DOKEY, the tab page is created, renamed and text is added to it. Have a look at this code-
private void button1_Click(object sender, EventArgs e)
{
War = new TabPage();
tabControl1.Controls.Add(War);
War.Text = "WAR";
}
private void War_Click(object sender, EventArgs e)
{
this.War.Controls.Add(this.dlabel[i]);
int x, y;
x = 200;
y = 200;

for (i = 0; i < dcount; i++)
{

dlabel[i].Visible = true;
dlabel[i].Location = new Point(x, y);
dlabel[i].Size = new Size(dlabel[i].PreferredWidth, dlabel[i].PreferredHeight);
dlabel[i].Text = "Destroyer";
x += 50;
}
}
Previously when i clicked the tabpage5(on my last post), the labels showed up(Please there is nothing wrong with the labels, they work just fine). Ive also added the tab page 'War' in my Form1 class-
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private game.destroyer[] dr = new game.destroyer[count];
private game.carrier[] cr = new game.carrier[count];
private game.submarine[] sr = new game.submarine[dcount];
private System.ComponentModel.IContainer components = null;
private System.Windows.Forms.Label[] dlabel = new System.Windows.Forms.Label[count];
private System.Windows.Forms.TabPage War = new System.Windows.Forms.TabPage();
The problem is that when i click the tab page, nothing happens.