PDA

Click to See Complete Forum and Search --> : Set Right to Left


Saee730d
Jun 10th, 2001, 04:50 AM
Public Declare Function SetWindowLong Lib "user32" Alias _
"SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Public Declare Function GetWindowLong Lib "user32" Alias _
"GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) _
As Long
Private Const WS_EX_LAYOUTRTL = &H400000
Private Const GWL_EXSTYLE = (-20)

Public Sub SetRtoL(Ctl As Control)
Ctl.Visible = False
SetWindowLong Ctl.hwnd, GWL_EXSTYLE, _
GetWindowLong(Ctl.hwnd, GWL_EXSTYLE) _
Or WS_EX_LAYOUTRTL
Ctl.Visible = True
End Sub

With this code I can't set Right to Left some control like:
1-ImageComboBox
2-Toolbar
3-SSTab ...

Please Help me to set them:( :( :(

Megatron
Jun 10th, 2001, 11:05 AM
I believe RightToLeft only works if your version of windows supports non-english.

Matthew Gates
Jun 10th, 2001, 06:45 PM
You could always make a function to make text right to left.


Private Function RightToLeftText(Text As String) As String
Dim vArray As Variant
Dim iArray As Integer
Dim sArray As String

vArray = Split(Text, " ")

For iArray = LBound(vArray) To UBound(vArray)
sArray = sArray & Chr(32) & StrReverse(vArray(iArray))
Next iArray

RightToLeftText = StrReverse(sArray)
End Function

Saee730d
Jun 11th, 2001, 01:44 AM
My version of Windows is non-english , and Rigth to Left is working with all Controls but with Toolbar & ImageComboBox.

saeed

BrianHawley
Sep 12th, 2001, 09:27 AM
Not all controls support righttoleft, particularly third-party tools. You may just have to work around it. Would you want to reverse a toolbar? Most Arabic applications leave them the same way - but maybe that's coz it's not easy to do.

Brian

BrianHawley
Sep 12th, 2001, 09:29 AM
Not all controls support righttopleft, particularly third-party tools. Would you want to reverse a toolbar? Most Arabic applications leave them the same way - but maybe that's coz it's not easy to do.

Brian