This ends up being a mutually exclusive situation unfortuntely. If someone has an idea for a solution I am all ears.
The only way I know of doing the rounded corners without custom bitmaps is to add elements to the control. Let's call them adornments.
So, you can either add the elements outside of the control you're targeting or inside.
If you add them outside it falls down quickly. If you have any positioning set on the thing you are targeting (relative or absolute), then the adornments get left behind. So that's a major problem.
If you add them inside the control (which is what we do), it generally works better, but there are combinations of styles that we can't handle, margin being one of them.
In most cases you can accomplish what you need to by composition - meaning if you wrap another div/panel around the outside of your object and apply the rounded cornders to that one or vice-versa you can make it do what you want.
Don't forget, this posting is provided "AS IS" with no warranties, and confers no rights.