Cool... note that you can add a bit more code to allow people to type the
property as long as it's valid. Kick the non-valid entries out while
allowing valid entries... it's up to you.
> Ken,
> It worked just fine!
> Thanks!
> Carlitos
> > Ken,
> > Thanks for the code. I'll try it and will let you know.
> > Thank you very much.
> > Carlitos
> > > Using the code below, a user/developer can type away at the property..
> but
> > > as soon as they leave that property entry box, or click anywhere with
> the
> > > mouse, it will revert back to what it was before they typed.... unless
> > > they're using the property page that is..
> > > '===============Property Page Code
> > > Option Explicit
> > > Dim oUC As UserControl1
> > > Private Sub txtTest_Change()
> > > Changed = True
> > > End Sub
> > > Private Sub PropertyPage_ApplyChanges()
> > > SelectedControls(0).Test = txtTest.Text
> > > oUC.PropPageActive = False
> > > End Sub
> > > Private Sub PropertyPage_SelectionChanged()
> > > Set oUC = SelectedControls(0)
> > > oUC.PropPageActive = True
> > > txtTest.Text = SelectedControls(0).Test
> > > End Sub
> > > '===============UserControl Code
> > > Option Explicit
> > > Dim m_Test As String
> > > Private mbPPAgeActive As Boolean
> > > Public Property Get Test() As String
> > > Test = m_Test
> > > End Property
> > > Public Property Let Test(ByVal New_Test As String)
> > > If mbPPAgeActive Then
> > > m_Test = New_Test
> > > PropertyChanged "Test"
> > > End If
> > > End Property
> > > Private Sub UserControl_InitProperties()
> > > m_Test = ""
> > > End Sub
> > > Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
> > > m_Test = PropBag.ReadProperty("Test", "")
> > > End Sub
> > > Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
> > > Call PropBag.WriteProperty("Test", m_Test, "")
> > > End Sub
> > > Friend Property Let PropPageActive(ByVal State As Boolean)
> > > 'This should be 'Friend' so it's public to the property
> > > 'page but private to the outside world
> > > mbPPAgeActive = State
> > > End Property
> > > '===============
> > > --
> > > Ken Halter
> > > MS-MVP-VB
> > > Please keep it in the groups..
> > > > Thanks Sean. Still no success. This property is a string and is
not
> > > > attached to an enum.
> > > > Does somebody have any other suggestions?
> > > > Carlitos
> > > > > I see what you mean. This also appears to happen with Boolean
> > > properties
> > > > > assigned to the property page. The only thing I can suggest is
> maybe
> > a
> > > > > magic number in the procedure ID box?? (Like -4 for collection
> > > > > enumerator)...
> > > > > Maybe someone else can help. Sorry.
> > > > > > Sean,
> > > > > > Thanks for your suggestion.
> > > > > > Nevertheless, I still want my property to be seen on the
property
> > > pane,
> > > > > but
> > > > > > prevent developers to change its value directly on the property
> pane
> > > but
> > > > > to
> > > > > > use my property page to do so.
> > > > > > Something like the Font property. You cannot change the value
> > through
> > > > the
> > > > > > property pane. You have to press the button with the ellipsis
> (...)
> > > on
> > > > > the
> > > > > > property in the property pane to get the porperty page to set up
> the
> > > > > desired
> > > > > > font.
> > > > > > Any other ideas?
> > > > > > Carlitos
> > > > > > > 1. Go to the code window for your user control.
> > > > > > > 2. In the menus pick Tools|Procedure Attributes.
> > > > > > > 3. In the dropcown at the top select the property you wish to
> > > > protect...
> > > > > > > 4. In the Attributes frame, check "Don't show in property
> > browser".
> > > > > > > > Hi there,
> > > > > > > > I created a custom control.
> > > > > > > > Among all the properties this control provides, there is one
> > > > property
> > > > > > that
> > > > > > > > developers cannot (should not) change through the VB
property
> > > pane.
> > > > > > > > I want to force developers to use the property page I
created
> > > > because
> > > > > my
> > > > > > > > property page provides functionalities needed to bring up
> values
> > > and
> > > > > > > > validate the values that can be assigned to this particular
> > > property
> > > > > of
> > > > > > > this
> > > > > > > > custom control.
> > > > > > > > Whatever the reason for doing this this way don't matter.
> > > > > > > > What matters is: How do I prevent developers to assign a
value
> > to
> > > > that
> > > > > > > > property on the property pane and force them to use my
> property
> > > > page?
> > > > > > > > Any ideas will be appreciated!
> > > > > > > > Thanks.
> > > > > > > > --
> > > > > > > > Carlitos