Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Newbie question
Sat, Feb 4 2017 4:32 AMPermanent Link

Uli Becker

Still a newbie in component developing:

I want to "override" the padding settings of a component derived from
TBasicPanel when tha component is created. IOW: I want to ignore any
values of the padding property entered by the user and use my own values.

Tried to do that in the OnCreate event of the component, but that
doesn't seem to work.

Thanks Uli
Wed, Feb 8 2017 1:50 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< Still a newbie in component developing:

I want to "override" the padding settings of a component derived from TBasicPanel when tha component is created. IOW: I want to ignore any values of the padding property entered by the user and use my own values.

Tried to do that in the OnCreate event of the component, but that doesn't seem to work. >>

What you want is the InitializeProperties method.  Override it, and make sure to call the inherited property first.

However, that won't help you if the developer using your component decides to set the Padding property manually.  To prevent that, you'll want to create your own control similar to TBasicPanel, but without publishing or exposing the Padding property.

Tim Young
Elevate Software
www.elevatesoft.com
Image