Board index » cppbuilder » How to rotate Labels in BCB?

How to rotate Labels in BCB?


2005-08-24 08:20:23 AM
cppbuilder98
Hi,
Is it possible to rotate Labels in BCB6?? I think it is not
possible, but is there any other way to achieve the same thing.
I wanted to have some labels vertically -- i.e. a normal
horizontal label rotated 90 degrees counter clockwise.
I will appreciate any suggestions.
thanks,
Veebo
 
 

Re:How to rotate Labels in BCB?

"Veebo" < XXXX@XXXXX.COM >wrote:
Quote

Is it possible to rotate Labels in BCB6??
Yes.
Quote
I think it is not possible,
You didn't search the archives did you?
Set the WordWrap property to true, it's Width to something
very small (to be precise, use a TControlCanvas and TextWidth
for "W" ) and then assign the Caption with spaces between each
letter to make it wrap, thus producing a vertical TLabel.
~ JD
 

Re:How to rotate Labels in BCB?

thanks JD.
Quote
You didn't search the archives did you?
Actually I did, but the solution I saw (provided by remy)
was..
"CreateFontIndirect() to create a logical font that has the
desired rotation in it. Then you can assign that
font onto the desired Canvas, then TextOut() can render the
text onto that canvas using that rotation."
I was looking for more of a simple way. I had a feeling that
there must be some little trick that will do the job, like the
one you suggested. I tried and works just how I needed it to.
thanks,
Veebo
 

{smallsort}

Re:How to rotate Labels in BCB?

"Veebo" < XXXX@XXXXX.COM >wrote in message
Quote
Actually I did, but the solution I saw (provided by remy)
was.."CreateFontIndirect() to create a logical font that has
the desired rotation in it. Then you can assign that font onto
the desired Canvas, then TextOut() can render the text onto
that canvas using that rotation."
That is what you have to do if you want true rotation.
Quote
I was looking for more of a simple way.
There isn't any, if you want true rotation. Using a rotated font via
CreateFontIndirect() is the only way to get true rotation.
Gambit
 

Re:How to rotate Labels in BCB?

Quote
if you want true rotation. Using a rotated font via
CreateFontIndirect() is the only way to get true rotation.
Gambit
thanks Gambit.
I understand what you are saying. I had found your solution in
the archive. I will use that in future when I need true
rotation. In my current situation, I just needed to display
labels on Horizontal and Vertical Rulers I have created for my
application. something "simple" like 100 200 300 400 for hori
and 1
0
0
2
0
0 etc for vertical.
thanks,
Veebo