../images/Emo41.gif Zeliran..
יש לי בשבילך את הקוד שהופך ListView:
public struct RECT { int Left; int Top; int Right; int Bottom; } public class HebrewListView : ListView { private const int GWL_EXSTYLE = -20; private const int WS_EX_LAYOUTRTL = 0x00400000; private const int GW_CHILD = 5; //------------------------------------------------------------------------- [DllImport("user32.dll")] public static extern System.IntPtr GetWindow(System.IntPtr hWnd, int wCmd); [DllImport("user32.dll")] public static extern int GetWindowLong(System.IntPtr hWnd, short index); [DllImport("user32.dll")] public static extern int SetWindowLong(System.IntPtr hWnd, short index, int newValue); [DllImport("user32.dll")] public static extern int GetClientRect(System.IntPtr hWnd, ref RECT r); [DllImport("user32.dll")] public static extern int InvalidateRect(System.IntPtr hWnd, ref RECT r, bool Erase); //------------------------------------------------------------------------- public HebrewListView() : base() { } protected override void OnCreateControl() { if(this.RightToLeft==RightToLeft.Yes) { base.OnCreateControl (); int old = GetWindowLong(this.Handle, GWL_EXSTYLE); SetWindowLong(this.Handle, GWL_EXSTYLE, old | WS_EX_LAYOUTRTL); RECT r = new RECT(); GetClientRect(this.Handle, ref r); InvalidateRect(this.Handle, ref r, true); System.IntPtr c = GetWindow(this.Handle, GW_CHILD); old = GetWindowLong(c, GWL_EXSTYLE); SetWindowLong(c, GWL_EXSTYLE, old | WS_EX_LAYOUTRTL); GetClientRect(c, ref r); InvalidateRect(c, ref r, true); } } }
זוהי בעצם מחלקה היורשת מ-ListView