I'm using C# in VS2008 on a machine running Vista
How to replicate:
1. Create new Windows Forms Applicationproject named "WindowsFormsApplication1"
2. Add new User Control to WindowsFormsApplication1 named "UserControl1"
3. Add a Button to UserControl1 from the Visual Studio Toolbox named "button1"
4. In code view, add the following code to the "public partial class UserControl1 : UserControl":
public bool ShowButton
{
get { return this.button1.Visible; }
set
{
if (this.button1.Visible != value)
{
this.button1.Visible = value;
}
}
}
5. Build the project and close the UserControl1
6. Add a TabControl to Form1 (by default Form1 was created when we created the project)
7. Add a UserControl1(named "userControl11")to TapPage1 of TabControl1 from the Visual Studio Toolbox
8. Add a UserControl1(named "userControl12")to TabPage2 of TabControl1from the Visual Studio Toolbox
9. Build the project and
notice thatthe "ShowButton" property of userControl12has changed from True to False on its own when we built the project10. Change the value of the "ShowButton" property of userControl12 to "True" (the button should re-appear)
11. Build the project and
notice thatthe "ShowButton" property of userControl11 haschanged from True to False on its own when we built the projectQ: Why are these controls changing each other's properties when we build the project?Here is a link to the project I created (to save you time):
http://www.matthodan.com/WindowsFormsApplication1.zipHere is a video of the problem:
http://www.matthodan.com/ExampleMovie.swf.html