I'm creating a control with command buttons and I want to allow the user to be able to change the Style of the button. I thought that I had everything set right in my code but each time I go to test it, it says that "You can't assign to a read-only property"I have the Get/Let properties setup the same way that I have the appearance property setup and that works fine so if anyone could shed some light on this I would really appreciate it. I'm including the code so you can see what I'm doing right/wrong
![]()
Public Property Get BtnStyle() As ButtonConstants
BtnStyle = btn.Style 'Gets the command button style.
End Property
Public Property Let BtnStyle(ByVal NewStyle As ButtonConstants)
'Sets the command button style to either (0-Standard) or
'(1-Graphic). Then changes the property.
btn.Style = NewStyle
UserControl.PropertyChanged "BtnStyle"
End Property




I have the Get/Let properties setup the same way that I have the appearance property setup and that works fine so if anyone could shed some light on this I would really appreciate it. I'm including the code so you can see what I'm doing right/wrong
Reply With Quote