Discussion:
RichTextBox Appearance property spits read-only error while building activeX user control.
(too old to reply)
Nick
2004-04-27 07:11:50 UTC
Permalink
Hi

I'm designing an ActiveX control which is basically a RichTextBox control
with a few extra properties and methods.
I've mapped most of the controls across from the RichTextBox to my control
except the Appearance property and the Scrollbars property. Both these
properties are read-only at runtime, which is what I want anyway. I simply
want these two properties to behave the same as if I was using just a
regular RichTextBox control.

I have 2 projects open in the IDE (VB6 SP3). One is the control (just a
RichTextBox), the other is a standard exe project with an instance of the
control on Form1. The standard exe project is set to startup.

I get a "Run-time error 383: Property is read only" error when I try to
change the Appearance property. If I remove the If Not Ambient....
statement, the error occurs when I simply open the form.

At no time am I running the project so why is it telling me I have a
run-time error?

I've tried using the Control Interface Wizard and it produces code which
causes the same error.

Thanks in advance

Nick


Public Property Let Appearance(ByVal conNew As
RichTextLib.AppearanceConstants)
If Not Ambient.UserMode Then
rtbEditor.Appearance = conNew 'fails on this line
PropertyChanged "Appearance"
End If
End Property

Public Property Get Appearance() As RichTextLib.AppearanceConstants
Appearance = rtbEditor.Appearance
End Property

Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
Appearance = PropBag.ReadProperty("Appearance", rtfThreeD)
'other properties omitted
End Sub

Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
PropBag.WriteProperty "AppearanceXXX", AppearanceXXX, rtfThreeD
'other properties omitted
End Sub
Nick
2004-04-27 23:54:00 UTC
Permalink
...by the way, the problem is not the XXX in the writeproperties func, that
was me stuffing around and forgetting to remove it before posting...
Post by Nick
Hi
I'm designing an ActiveX control which is basically a RichTextBox control
with a few extra properties and methods.
I've mapped most of the controls across from the RichTextBox to my control
except the Appearance property and the Scrollbars property. Both these
properties are read-only at runtime, which is what I want anyway. I simply
want these two properties to behave the same as if I was using just a
regular RichTextBox control.
I have 2 projects open in the IDE (VB6 SP3). One is the control (just a
RichTextBox), the other is a standard exe project with an instance of the
control on Form1. The standard exe project is set to startup.
I get a "Run-time error 383: Property is read only" error when I try to
change the Appearance property. If I remove the If Not Ambient....
statement, the error occurs when I simply open the form.
At no time am I running the project so why is it telling me I have a
run-time error?
I've tried using the Control Interface Wizard and it produces code which
causes the same error.
Thanks in advance
Nick
Public Property Let Appearance(ByVal conNew As
RichTextLib.AppearanceConstants)
If Not Ambient.UserMode Then
rtbEditor.Appearance = conNew 'fails on this line
PropertyChanged "Appearance"
End If
End Property
Public Property Get Appearance() As RichTextLib.AppearanceConstants
Appearance = rtbEditor.Appearance
End Property
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
Appearance = PropBag.ReadProperty("Appearance", rtfThreeD)
'other properties omitted
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
PropBag.WriteProperty "AppearanceXXX", AppearanceXXX, rtfThreeD
'other properties omitted
End Sub
dnagel
2004-04-28 00:28:14 UTC
Permalink
Post by Nick
I get a "Run-time error 383: Property is read only" error when I try to
change the Appearance property. If I remove the If Not Ambient....
statement, the error occurs when I simply open the form.
At no time am I running the project so why is it telling me I have a
run-time error?
I've tried using the Control Interface Wizard and it produces code which
causes the same error.
AxControl properties also fire at design time when the control is being
drawn on the form...

D.
h***@gmail.com
2014-11-25 07:27:39 UTC
Permalink
Moles: appearance This is a difficult question. Moles may have many different shapes, colors and character. They vary in color from pink to flesh-colored to dark brown. Most are round or oval in shape. They may also have an unusual shape, without this meaning that they are malignant. They vary in size from a few millimeters to several centimeters in diameter. - See more at: http://www.oslohudlegesenter.no/f%c3%b8flekker-bid-47.html#sthash.jo5xI2PY.dpuf
http://www.oslohudlegesenter.no/

Loading...