How do I make a text box with rounded corners on top only

I want to make a text box with rounded corners on top only. The bottom will have square corners.

I’m pretty sure the solution lies in putting a rounded corner rectangle behind my content, positioned to extend above the top of the content but shorter than the bottom of the content.

Am I on the right track here? It does anyone have a better idea?

You’re exactly right. Put a rectangle in the very back (rounded) with space above the top of the content. You can put another rectangle on the bottom with no rounding.

In this example, I have it exactly how you describe it. The blue “Cancel” button has rounded corners on the top. The dark grey rectangle has 1 rounded corner on the top-right.