ورود

View Full Version : سوال: مشکل در right to left ابزار list view



Shahab.
پنج شنبه 20 تیر 1392, 19:36 عصر
با سلام
من تمام ستون های ابزار list view رو راست به چپ تنظیم کردم ولی زمانی که توی یک جمله مثلا علامت ! آخرش هست مثل :
ایران من !
وقتی که توی ساب آیتم لیست ویو نمایشش میدم اینجوری میشه :
! ایران من
_________________________
یعنی میاد اول جمله
چند بار هم اون ستون رو چک کردم دیدم که بله right to left هست و حتی عنوان ستون هم درسته یعنی از راست نوشته شده ولی ساب آیتم هاش این مشکلو دارن

چیکار کنم؟ :افسرده:

Shahab.
پنج شنبه 20 تیر 1392, 23:58 عصر
یعنی هیچ کس بلد نیست

m.4.r.m
جمعه 21 تیر 1392, 00:17 صبح
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


Private Sub Form_Load()
ListRTL ListView1

End Sub