USE PROPERTY PAGE INSTEAD OF PROPERTY PANE!!! 
Author Message
 USE PROPERTY PAGE INSTEAD OF PROPERTY PANE!!!

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



Sun, 05 Sep 2004 21:20:54 GMT  
 USE PROPERTY PAGE INSTEAD OF PROPERTY PANE!!!
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".


Quote:
> 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



Sun, 05 Sep 2004 21:39:38 GMT  
 USE PROPERTY PAGE INSTEAD OF PROPERTY PANE!!!
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


Quote:
> 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



Sun, 05 Sep 2004 22:06:55 GMT  
 USE PROPERTY PAGE INSTEAD OF PROPERTY PANE!!!
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.


Quote:
> 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



Sun, 05 Sep 2004 22:52:37 GMT  
 USE PROPERTY PAGE INSTEAD OF PROPERTY PANE!!!

Thanks Sean.  Still no success.  This property is a string and is not
attached to an enum.

Does somebody have any other suggestions?

Carlitos


Quote:
> 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



Sun, 05 Sep 2004 23:15:58 GMT  
 USE PROPERTY PAGE INSTEAD OF PROPERTY PANE!!!
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..


Quote:

> 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



Mon, 06 Sep 2004 00:05:18 GMT  
 USE PROPERTY PAGE INSTEAD OF PROPERTY PANE!!!
Ken,

Thanks for the code.  I'll try it and will let you know.

Thank you very much.

Carlitos


Quote:
> 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



Mon, 06 Sep 2004 05:35:43 GMT  
 USE PROPERTY PAGE INSTEAD OF PROPERTY PANE!!!
Ken,

It worked just fine!

Thanks!

Carlitos


Quote:
> 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



Mon, 06 Sep 2004 22:40:56 GMT  
 USE PROPERTY PAGE INSTEAD OF PROPERTY PANE!!!
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 Halter
MS-MVP-VB
Please keep it in the groups..


Quote:
> 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



Mon, 06 Sep 2004 23:08:40 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Using property instead of properties.item

2. List Property in Property Pane (PLEASE HELP!)

3. Host for Property Pages or Public Property Page

4. Host for Property Pages or Public Property Page

5. Q: Property Sheets / Property Page How to

6. Modify property of property page

7. Creating properties pane like control

8. Open Dialog box from the Properties pane.

9. Using the Property Browser for aetting app Properties.

10. Running functions addi using the Property Page

11. Programmatically Set Excel Page SetUp properties using VB

12. Problem after using Add Property Page with Wizard

 

 
Powered by phpBB® Forum Software