|
-
Feb 10th, 2004, 10:12 PM
#1
Thread Starter
Hyperactive Member
*RESOLVED* values overridden with defaults
I want to set some public values in my ActiveX control I'm creating for defaults. This I can do fine. The user can change the values at design-time just fine, but when the program is run, the defaults take over again (because the initialize event is triggered). How do I set default values that won't override the user's?
Note: If the user sets the values at run-time it will work fine because it is after the initialize sub is called.
cjqp
Last edited by cjqp; Feb 12th, 2004 at 03:14 PM.
-
Feb 10th, 2004, 10:27 PM
#2
You need to read and write your property values to a propertybag using the ReadProperties and WriteProperties events...
VB Code:
Private mText As String
Public Property Let Text(ByVal s As String)
mText = s
End Property
Public Property Get Text() As String
Text = mText
End Property
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
Me.Text = PropBag.ReadProperty("Text", "")
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("Text", Me.Text, "")
End Sub
See if that makes a difference.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 11th, 2004, 11:26 PM
#3
Thread Starter
Hyperactive Member
I can't seem to quite grasp this, even after reading VBs help...do you know of a tutorial?
cjqp
-
Feb 12th, 2004, 03:14 PM
#4
Thread Starter
Hyperactive Member
Aha, figured it out, thanks for the help!
cjqp
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|