Results 1 to 6 of 6

Thread: Set Right to Left

  1. #1
    New Member
    Join Date
    May 01
    Location
    UK
    Posts
    7

    Unhappy Set Right to Left

    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

  2. #2
    Megatron
    Guest
    I believe RightToLeft only works if your version of windows supports non-english.

  3. #3
    Matthew Gates
    Guest
    You could always make a function to make text right to left.


    VB Code:
    1. Private Function RightToLeftText(Text As String) As String
    2.     Dim vArray As Variant
    3.     Dim iArray As Integer
    4.     Dim sArray As String
    5.    
    6.     vArray = Split(Text, " ")
    7.  
    8.     For iArray = LBound(vArray) To UBound(vArray)
    9.         sArray = sArray & Chr(32) & StrReverse(vArray(iArray))
    10.     Next iArray
    11.  
    12.     RightToLeftText = StrReverse(sArray)
    13. End Function

  4. #4
    New Member
    Join Date
    May 01
    Location
    UK
    Posts
    7
    My version of Windows is non-english , and Rigth to Left is working with all Controls but with Toolbar & ImageComboBox.

    saeed

  5. #5
    Fanatic Member BrianHawley's Avatar
    Join Date
    Aug 01
    Location
    Saudi Arabia
    Posts
    796
    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

  6. #6
    Fanatic Member BrianHawley's Avatar
    Join Date
    Aug 01
    Location
    Saudi Arabia
    Posts
    796
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •