Charlie, thanks for you answer and I learned some thing from it. However,
what I want to do is show defaults in the Properties Box at Design time. For
example, I have added a property to my derived class (derives from panel
class) for HorzAlignment and I want it to show the designer a default of
"Center" instead of the current "Near".
Thanks again for your answer.
> In a User Control Library, you can create a new UserControl class. This is
> the class you would use for controls that are made of several constituent
[quoted text clipped - 41 lines]
> >
> > Would appreciate any help.
Try this in your derived Panel code:
Private _HorzAlignment As String = "Near"
> Public Property Field() As String
> Get
> Return Me._HorzAlignment
> End Get
> Set(ByVal Value As String)
> Me._HorzAlignment = Value
'Additional code to modify HorzAlignment
> End Set
> End Property
That should work for the Property Window. That would set the initial value
to "Near".
I have found that sometimes I have the Toolbox pointing to a .dll that is
not being updated by the Re-build. You can check that by making another
temporary change to the control that you know you would be able to see.
I might also suggest that you use an Enum for your variable type for
HorzAlignment, since it is likely a limited number of possible items.
> Charlie, thanks for you answer and I learned some thing from it. However,
> what I want to do is show defaults in the Properties Box at Design time. For
[quoted text clipped - 49 lines]
> > >
> > > Would appreciate any help.
Dennis - 31 Oct 2004 19:44 GMT
Charlie, you are absolutely correct. When I change the setting in my control
then rebuild it, the new values show up in the Design time Property table
exactly as I had set them to before the rebuild. Thanks a lot.
> Try this in your derived Panel code:
>
[quoted text clipped - 71 lines]
> > > >
> > > > Would appreciate any help.