Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Cannot modify visible property for public button control in inherited form
 

Cannot modify visible property for public button control in inherited form

I am trying to modify the visible property of a control in an inherited form. The base class is a form in a dll. The inheriting form is in a different DLL in the same solution workspace. All the controls appear as expected in the inheriting form. Most of the controls in the base class form are public so that I can move, or hide them in the inheriting form. I have succeeded in positioning and hiding many of the controls in the inheriting form. Then I added a new button to the base class. Initially I had difficulty getting the new button to show up in the inheriting class, but after cleaning and rebuilding and getting out of Studio and back in many times, eventually the new control appeared in the inheriting class (I don't know what I did that finally made the new control appear). Now I am trying to change the visible property of the new control in the inheriting class. When I do this I get the following compile error:

Error1'SEL.CustomForms.formStatusData' does not contain a definition for 'buttonShowGrid'C:\Demo\MeterDevice\CustomForms\DataStatus.Designer.cs31818CustomForms

This error results from the new code that was inserted by the designer into my inheriting class's designer code file:

//

// buttonShowGrid

//

this.buttonShowGrid.Visible = false;

This code seems correct. The only way to get rid of the error is to remove this code. But I want to hide the control, so how do I do it?

I think there must be some corruption in my designer files somewhere, but I have no idea how to find it. There is no other apparent problem. The application works as expected. I have read through many postings that seem related to my problem, but none of the solutions offered help me. I am happy to share my project files with anyone willing to take a look.

KMyers1  Monday, March 24, 2008 5:24 PM

I found the solution to this problem. The project containing my inheriting class had a reference to the dll containing the base class. When I removed this reference, the problem went away.

KMyers1  Tuesday, March 25, 2008 12:15 AM

I found the solution to this problem. The project containing my inheriting class had a reference to the dll containing the base class. When I removed this reference, the problem went away.

KMyers1  Tuesday, March 25, 2008 12:15 AM

You can use google to search for other answers

Custom Search

More Threads

• How to display combobox with DropDown as DropDownStyle in PropertyGrid
• Which Components and Controls can be used as MDIParent??
• Windows Form Designer does not include the section 'Windows Forms Generated Code'
• how to write text on image dynamically through drag and drop control in C#
• Cannot inherit form from base class form in DLL
• StatusBar panel collection
• Controling Enabling/Disabling textbox color
• CanConvertTo Not Called
• How to quick tab to a textbox with ALT?
• Understanding ZOrder