How can i Fix it as below?

When I set the captionangle value to 90, I expect the control to change 90 degrees, but it doesn't. How can I solve the problem like the image on the right? I know that the GDIP_AddPathString function must change.