problem with Command1.visible property in UserControl
Posted on 2001-07-19
I am having a weird problem, i hope someone can tell me where i am going wrong.
My requirements are one simple usercontrol with a command button and a property "visible" for the command button. My code for the usercontrol are as below:
Public Property Get showButton() As Boolean
showButton = cmdButton.Visible
Public Property Let showButton(ByVal New_showButton As Boolean)
cmdButton.Visible() = New_showButton
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
cmdButton.Visible = PropBag.ReadProperty("showButton", False)
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("showButton", cmdButton.Visible, False)
The code above works fine, if i have a standalone project with one form and one usercontrol but if i copy and paste this code in one of my usercontrol in the project where i am using visual sourcesafe, it gives me weird results.
In this project, if i put the usercontrol on one of the form and change the "showbutton" property, it works fine if i close and open the form but once i save the project and open it again the property is lost and it changes to false.
Its not that the project is not saved, the changes other than the property are changed.
I am tired of this error. Does anyone have idea about what i am doing wrong......
Any kind of help would be appreciated.