I know this is an old question, but there is still no good documentation on how to do this. I ended up here myself trying to figure this out and thought that others ending up here for the same reason deserve an explanation on how to do this.
In the writing moment, I'm using C++ Builder 10.4 (Sydney).
There is a package called designide
that you need to add as a reference to your project.
- In your package project, right click on "Requires" and select "Add Reference..."
- Click the "Browse" button and go to your install folder look for
designide.bpi
in lib\win32\release
or lib\win64\release
depending on your target.
The include path must also be updated so it can find the header file.
- Right click on your package project and select "Options"
- Select "Shared Options"
- For convenience, set "Target" to "All configurations - All platforms".
- Select "Include path" and click on the "..." to edit the value.
- Add the line
$(BDSINCLUDE)\windows\vcl\design
- Click the Ok button and then save the changes.
In your code add #include <DesignIntf.hpp>
and use the function UnlistPublishedProperty()
to unpublish properties in your package function Register()
.
void __fastcall PACKAGE Register() {
// Register components
TComponentClass classes[1] = {__classid(TMyVCLClass)};
RegisterComponents(L"MyComponent", classes, 0);
// Unpublish properties
UnlistPublishedProperty(__classid(TMyVCLClass),L"AlignWithMargins");
UnlistPublishedProperty(__classid(TMyVCLClass),L"Margins");
}