السلام عليكم
الاخ ابو ادم
اولا اشكرك لمرورك ولكلماتك الجميلة
ثنيا انا سعيدا جدا لتطبيقك الشرح و نجاحك فيه
اما بخصوص طلبك بعد جهدا حهيد اليك الحل
اولا ضع هذا الكود في بداية الاكواد الخاصة باليوزر فورم
Option Explicit
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Const GW_CHILD = 5
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_LAYOUTRTL = &H400000
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetClientRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function InvalidateRect Lib "user32.dll" (ByVal hwnd As Long, lpRect As RECT, ByVal bErase As Long) As Long
Private Declare Function GetWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Private Sub ListRTL(Liv As ListView)
Dim rClientRect As RECT
Dim ReturnStyle As Long
Dim Header_hWnd As Long
ReturnStyle = GetWindowLong(Liv.hwnd, GWL_EXSTYLE)
SetWindowLong Liv.hwnd, GWL_EXSTYLE, ReturnStyle Or WS_EX_LAYOUTRTL
GetClientRect Liv.hwnd, rClientRect
InvalidateRect Liv.hwnd, rClientRect, True
Header_hWnd = GetWindow(Liv.hwnd, GW_CHILD)
ReturnStyle = GetWindowLong(Header_hWnd, GWL_EXSTYLE)
SetWindowLong Header_hWnd, GWL_EXSTYLE, ReturnStyle Or WS_EX_LAYOUTRTL
GetClientRect Header_hWnd, rClientRect
InvalidateRect Header_hWnd, rClientRect, True
End Sub
ثانيا ضع هذا الكود في حدث UserForm_Activate
ListRTL ListView1
الثا ستضهر لديك مشكلة عند تشغيل الفورم هي مشكلة تعريف المتغيرات
استبدل الاكواد الاولى اي المتغيرات في UserForm_Initialize
بهذه الاكواد
Dim I As Integer, Y As Integer, LastRow As Integer, LastColumn As Integer
Dim cel, Rng, sh
جرب ولاحض بنفسك
مع تحياتي وشكري