Preserving the values of a property, changed in design time 
Author Message
 Preserving the values of a property, changed in design time

Hi!

I'm building a VB6 Control I define some properties in the control's code
like this:

'Control's Code
'-----------------------------------

Public Enum SomeValues
  X = 0
  Y = 1
End Enum

Private MyValue As SomeValues

Public Property Get CustomValue() As SomeValues
   CustomValue = MyValue
End Property

Property Let CustomValue(Value As SomeValues)
   MyValue = Value
End Property

'-----------------------------------

Now, when I'm using the control, I set the property in design time, but when
the application is running the value of the property is the initial
property, not the one who I defined... What's left or what's missing on the
Property Let Instruction...

Thanks!



Thu, 30 Jun 2005 04:27:45 GMT  
 Preserving the values of a property, changed in design time
Have a look at the ReadProperties, WriteProperties, and InitProperties
events

as well as the PropertyChanged method.

D.


Quote:
> Hi!

> I'm building a VB6 Control I define some properties in the control's code
> like this:

> 'Control's Code
> '-----------------------------------

> Public Enum SomeValues
>   X = 0
>   Y = 1
> End Enum

> Private MyValue As SomeValues

> Public Property Get CustomValue() As SomeValues
>    CustomValue = MyValue
> End Property

> Property Let CustomValue(Value As SomeValues)
>    MyValue = Value
> End Property

> '-----------------------------------

> Now, when I'm using the control, I set the property in design time, but
when
> the application is running the value of the property is the initial
> property, not the one who I defined... What's left or what's missing on
the
> Property Let Instruction...

> Thanks!



Thu, 30 Jun 2005 08:48:54 GMT  
 Preserving the values of a property, changed in design time
Did you include these properties in your InitProperties
and REadProperties event procedures?

example:
reading property from storage
     CustomValue = PropBag.ReadProperties("My Property
Name",default value)

writing property:
     PropBag.WriteProperties("My Property
Name",CustomValue)

Barth

Quote:
>-----Original Message-----
>Hi!

>I'm building a VB6 Control I define some properties in
the control's code
>like this:

>'Control's Code
>'-----------------------------------

>Public Enum SomeValues
>  X = 0
>  Y = 1
>End Enum

>Private MyValue As SomeValues

>Public Property Get CustomValue() As SomeValues
>   CustomValue = MyValue
>End Property

>Property Let CustomValue(Value As SomeValues)
>   MyValue = Value
>End Property

>'-----------------------------------

>Now, when I'm using the control, I set the property in

design time, but when
Quote:
>the application is running the value of the property is
the initial
>property, not the one who I defined... What's left or

what's missing on the

- Show quoted text -

Quote:
>Property Let Instruction...

>Thanks!

>.



Thu, 30 Jun 2005 23:45:31 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Changing property default values at design time

2. *** Refreshing control at design time when property changed?

3. Changing design time properties during execution

4. Changing design time properties at runtime

5. Saving properties of ActiveX control from design time to run time

6. Accessing design time properties in run time

7. Changing lower array bound + preserving its content at the same time

8. Design-time properties in Run-time Controls

9. Design time or run time, setting properties

10. Assign a treeview at design run time to other at design time

11. Enum: count values at design time

12. Userform Visibility property in design time

 

 
Powered by phpBB® Forum Software