I want to make a component based on a TFrame with TLMDShapeControl (for drawing round corner background) and a TEdit control (that can be also a TComboBox or a TDBEdit and so on).
After that I will use the “Add to Palette” command to turn it into a Reusable Component Control.
The problem in that I need it to be width flexible and for that I had the idea of turn everything inside the Frame alClient and the TEdit with 5 pixel margin so the user can see the rounded corners.
It was terrible because I can’t use Align and set components one in the top of another. Now I have to copy and paste the components on every time I have to use it! :-(((
The only way I see the right thing is to use only the TEdit with alClient and 5px margin and no TShape. Instead I could make the TFrame to be rounded corner with transparency, so it won’t look ugly on of different colors or TImages.
But how do I do that?
Does anyone have any code sample?

To answer your question how to make frame with rounded corners you can try something like this, but you will be dissatisfied with the result since the
CreateRoundRectRgnused here has no antialiasing.Update:
Since GDI doesn’t have any function that would support antialiasing for arc rendering, I’ve posted here an example of a round rectangle shape (just a pure filled round rectangle) that uses GDI+ (for this you will need GDI+ wrappers
from here).The following properties are important for its use:
And the result (with
SmoothingModeAntiAliassmoothing mode applied):One can say it’s a big overhead to use GDI+ for such tiny thing but pure GDI render without antialiasing what makes the results looks ugly. Here is the example of the same round rectangle rendered by using pure GDI: