G
Guest
Being a .NET beginner, I'm having problems with the TabControl in the .NET Compact Framework
The TabControl seams to be messed up when I in run time remove TabPages form the control
The problem can be illustrated as follows
Using Dev Studio 2003 - create a C# Smart Device Application (for Pocket PC
Add a TabControl to the for
In the Form_Load add the following code
private void Form1_Load(object sender, System.EventArgs e
System.Windows.Forms.TabPage tabPage = new TabPage()
tabPage.Text = "Page 1"
this.tabControl1.TabPages.Add(tabPage)
tabPage = new TabPage()
tabPage.Text = "Page 2"
this.tabControl1.TabPages.Add(tabPage)
this.tabControl1.TabPages.RemoveAt(0)
MessageBox.Show(this.tabControl1.TabPages[0].Text)
Run the program. (I'm running on a Dell Axim device with Pocket PC version 4.20.1081 and .NET CF 1.0 Service Pack 2
You will see a crash when the Message Box is shown. (I would expect to see "Page 2"
I tried to do the same in a Windows Application, which works fin
Am I doing something wrong here?
Is this a bug?
Is there a work around for this problem? (My application needs to Add and remove TabPages in Run time
Thanks for your help
The TabControl seams to be messed up when I in run time remove TabPages form the control
The problem can be illustrated as follows
Using Dev Studio 2003 - create a C# Smart Device Application (for Pocket PC
Add a TabControl to the for
In the Form_Load add the following code
private void Form1_Load(object sender, System.EventArgs e
System.Windows.Forms.TabPage tabPage = new TabPage()
tabPage.Text = "Page 1"
this.tabControl1.TabPages.Add(tabPage)
tabPage = new TabPage()
tabPage.Text = "Page 2"
this.tabControl1.TabPages.Add(tabPage)
this.tabControl1.TabPages.RemoveAt(0)
MessageBox.Show(this.tabControl1.TabPages[0].Text)
Run the program. (I'm running on a Dell Axim device with Pocket PC version 4.20.1081 and .NET CF 1.0 Service Pack 2
You will see a crash when the Message Box is shown. (I would expect to see "Page 2"
I tried to do the same in a Windows Application, which works fin
Am I doing something wrong here?
Is this a bug?
Is there a work around for this problem? (My application needs to Add and remove TabPages in Run time
Thanks for your help