views:

226

answers:

2

Hello, I wrote a little C# program that displays text in a balloon tip from time to time. When the text is in English, there's no problem : Everything is aligned to the left and is readable, but sometimes I have some Hebrew text and a left alignment of a RTL language gets all screwy. I was wondering if there's a way to right-align the Hebrew text ?

Google pointed me to articles that can help me change the balloon color and font, but none of them have an alignment argument.

Is it even possible ?

Any help will be appropriated. John

+1  A: 

The WF ToolTip control uses the form's RightToLeft property to determine how to align its text. Displaying RTL text when you have a form that otherwise displays text left to right is an unusual requirement, not covered by the class. Setting the form's RightToLeft property to Yes before you display the tip isn't going to look very pleasant.

The alternative is to use custom drawing by setting the tool tip's OwnerDraw property to True. A good example for a Draw event handler is available in the MSDN Library. You'll want to use TextFormatFlags.RightToLeft.

Hans Passant
A: 

I successfully managed to custom draw a right to left tooltip, but is there a way to do it for a BalloonTip ? And since I forgot to mention it in my first post, My program is a standard WinForms program.