Bug in TabControl?

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
 
P

Peter B

I get the same result, maybe someone from MS should take a look at this!

/ Peter


Claus said:
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 form
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)
 
D

David So [MSFT]

Thanks for reporting this bug to us, we'll take a look at it and make sure
it get fix in the next version.

David
This posting is provided "AS IS" with no warranties, and confers no rights.
 
B

Boris Nienke

What type of bug? I'm working with TabControl and want to know.
Thanks

Original posting by "Claus" was:

----8<-----snip-----8<---------snap-----------
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 form
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 fine

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
----8<-----snip-----8<---------snap-----------

boris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top