السلام عليكم ورحمه الله وبركاته اخواني الكرام الان الحل لمعظم الادوات التي لا تحتوي على خاصية Right to left مثل ListStatusBarTreeView ListViewProgressBarToolBarالحل قم بانشاء موديل و اضافة فيها شيفرة الـ Api التالية
Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As LongPublic Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As LongPublic Declare Function InvalidateRect Lib "user32" (ByVal hwnd As Long, lpRect As Long, ByVal bErase As Long) As LongPublic Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As LongDeclare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As LongPublic Const GW_CHILD = 5Public Const WS_EX_LAYOUTRTL = &H400000Public Const GWL_EXSTYLE = (-20)
و اذا كنت ستتخدم الشيفرة في general declaratio (قسم التصريحات)قم بتغير جملة التعريف من public الى الـ private وقم باضافة الكود المطلوب للادة التي تحتاجهة في حدث الـ Form_load من الاكودا التالية :
Private Sub Form_Load() 'On Form Load you need to set the mirroring
for Control
Dim OldLong As Long OldLong = GetWindowLong(Me.hwnd, GWL_EXSTYLE) SetWindowLong Me.hwnd, GWL_EXSTYLE, OldLong Or WS_EX_LAYOUTRTL InvalidateRect hwnd, 0, False 'For List OldLong = GetWindowLong(List1.hwnd, GWL_EXSTYLE) SetWindowLong List1.hwnd, GWL_EXSTYLE, OldLong Or WS_EX_LAYOUTRTL InvalidateRect hwnd, 0, False
list
OldLong = GetWindowLong(List1.hwnd, GWL_EXSTYLE) SetWindowLong List1.hwnd, GWL_EXSTYLE, OldLong Or WS_EX_LAYOUTRTL InvalidateRect hwnd, 0, False
StatusBar
OldLong = GetWindowLong(StatusBar1.hwnd, GWL_EXSTYLE) SetWindowLong StatusBar1.hwnd, GWL_EXSTYLE, OldLong Or WS_EX_LAYOUTRTL InvalidateRect hwnd, 0, False
TreeView
Dim nodX As Node Set nodX = TreeView1.Nodes.Add(, , "R", "Root") Set nodX = TreeView1.Nodes.Add("R", tvwChild, "C1", "Child 1") Set nodX = TreeView1.Nodes.Add("R", tvwChild, "C2", "Child 2") Set nodX = TreeView1.Nodes.Add("R", tvwChild, "C3", "Child 3") Set nodX = TreeView1.Nodes.Add("R", tvwChild, "C4", "Child 4") nodX.EnsureVisible OldLong = GetWindowLong(TreeView1.hwnd, GWL_EXSTYLE) SetWindowLong TreeView1.hwnd, GWL_EXSTYLE, OldLong
Or WS_EX_LAYOUTRTL InvalidateRect hwnd, 0, Falseend sub
