tags:

views:

108

answers:

2

I am programming in a Hebrew environment and so I want the tabs on the top of a TTabControl to be displayed from right to left. The BiDiMode property doesn't affect the tabs, but rather text contained within the control.

I have tried the following code

SetWindowLong (tc.Handle, GWL_EXSTYLE,
               GetWindowLong(tc.Handle, GWL_EXSTYLE)  or
               WS_EX_LAYOUTRTL or WS_EX_NOINHERITLAYOUT);

which gets the tabs displayed correctly, but prevents the controls held within the ttabcontrol from appearing, and so its use is somewhat limited.

Any ideas? BTW, I'm using Delphi 7.

TIA, No'am

+1  A: 

I tried the code with D2007 and it's working fine on windows7.

But you could use Raize controls, their PageControl and TabControl could be showed from RightToLeft without any code.

Mohammed Nasman
I need a solution with works with Delphi 7 and windows XP.
No'am Newman
+1 for Raize controls, and there are many other components which can help make your program shine. http://www.raize.com
skamradt
No'am, Raize will solve your problem at any Delphi version or at any windows, beside it will give you much better interface and more advanced controls.
Mohammed Nasman
A: 

I've found a solution, which while not ideal, is better than nothing. I'm using TabAlign = tbRight, and owner drawing the tabs so that their text appears on the screen as horizontal. Here's a link to the screen shot of the tab control as it is at the moment: http://4.bp.blogspot.com/_rdlpltE1gDQ/SyNFvVNNe5I/AAAAAAAAAEQ/2DNVlKqRlWE/s1600-h/screen5.JPG)

I would still be appreciative of an answer which has the tabs on the top of the control, but aligned to the right of the control instead of to the left.

No'am Newman