Windows Develop Bookmark and Share   
 index > Windows Forms Designer > TabControl behaving strangly
 

TabControl behaving strangly

Hi
Can anyone help me witha problem.
I am using a tabControl with 3 tabs. I can place object on the first two tab pages and everything works as expected however when I place objects in the 3rd tabpage and then click on them to arrange them the way I want them they disapear though tabpage3 and tabpage2 and apear on tabpage1.

I've tried removeing tabpage3 and creating it again - That didn't help.
Checked and compared the properties for all tabpages to make sure they all had the same settings.
restarting VB2008 Express application and rebooting the computer.

What might have caused the problem was that I had a panel on tabpage3 and then cut and pasted it on tabpage1 and since then all controls I drag onto tabpage3 go strait through the tabcontrol to tabpage1.

I hope that is understandable.
iDigiSoft-Daniel  Saturday, March 07, 2009 5:10 AM

Hi iDigiSoft-Daniel,

Please look into the [FormName].Designer.cs file to see whether these controls are added to the tabpage correctly.

In the [FormName].Designer.cs file, you can see the code like this.
I have added three tabpages to the TabControl.

tabpage1 has:
dataGridView1
button1

tabpage2 has:
dateTimePicker1
checkBox1
...

//
//tabPage1
//
this.tabPage1.Controls.Add(this.dataGridView1);
this.tabPage1.Controls.Add(this.button1);
//
//tabPage2
//
this.tabPage2.Controls.Add(this.dateTimePicker1);
this.tabPage2.Controls.Add(this.checkBox1);
//
//tabPage3
//
this.tabPage3.Controls.Add(this.textBox1);
this.tabPage3.Controls.Add(this.comboBox1);

Please try to change that code into correct one. Then you can get back the controls on your tabpage3.

Please feel free to tell me if you have anything unclear.

Sincerely,
Kira Qian


Please mark the replies as answers if they help and unmark if they don't.
Kira Qian  Tuesday, March 10, 2009 6:35 AM
Don't do cut and paste in IDE.
Thanks, A.m.a.L
A.m.a.L - aditi.com - Think Product  Sunday, March 08, 2009 2:55 PM

Hi iDigiSoft-Daniel,

Please look into the [FormName].Designer.cs file to see whether these controls are added to the tabpage correctly.

In the [FormName].Designer.cs file, you can see the code like this.
I have added three tabpages to the TabControl.

tabpage1 has:
dataGridView1
button1

tabpage2 has:
dateTimePicker1
checkBox1
...

//
//tabPage1
//
this.tabPage1.Controls.Add(this.dataGridView1);
this.tabPage1.Controls.Add(this.button1);
//
//tabPage2
//
this.tabPage2.Controls.Add(this.dateTimePicker1);
this.tabPage2.Controls.Add(this.checkBox1);
//
//tabPage3
//
this.tabPage3.Controls.Add(this.textBox1);
this.tabPage3.Controls.Add(this.comboBox1);

Please try to change that code into correct one. Then you can get back the controls on your tabpage3.

Please feel free to tell me if you have anything unclear.

Sincerely,
Kira Qian


Please mark the replies as answers if they help and unmark if they don't.
Kira Qian  Tuesday, March 10, 2009 6:35 AM
Thank Guy's for your help.

I haven't varified my email address to msn and therefore haven't been notified about replies to my question.

I sorted it out by REBUILDING THE WHOLE THING. I better varify my email address.

Thanks
iDigiSoft-Daniel  Tuesday, March 17, 2009 11:24 AM

You can use google to search for other answers

Custom Search

More Threads

• Positioning Tools in the html Designer
• Derived datagridview duplicates columns in designer
• Catastrophic failure:
• form generic type inherit problem
• Error message in designer after adding a control
• I need a Deleat enterd Data
• Simple One: Pass Information From Custom Control Back Up Chain
• Right way to do a custom control?
• Context Menu With DataGridView
• How to hide the component tray in the designer?