Esempio n. 1
0
 public static void SetExtendedStyle(Control control, ListViewExtendedStyles exStyle)
 {
     ListViewExtendedStyles styles;
     styles = (ListViewExtendedStyles)SendMessage(control.Handle, (int)ListViewMessages.GetExtendedStyle, 0, 0);
     styles |= exStyle;
     SendMessage(control.Handle, (int)ListViewMessages.SetExtendedStyle, 0, (int)styles);
 }
Esempio n. 2
0
        public static void SetExtendedStyle(Control control, ListViewExtendedStyles exStyle)
        {
            ListViewExtendedStyles styles;

            styles  = (ListViewExtendedStyles)SendMessage(control.Handle, (int)ListViewMessages.GetExtendedStyle, 0, 0);
            styles |= exStyle;
            SendMessage(control.Handle, (int)ListViewMessages.SetExtendedStyle, 0, (int)styles);
        }
Esempio n. 3
0
        /// <summary>
        /// Sets the extended style.
        /// </summary>
        /// <param name="control">The control.</param>
        /// <param name="exStyle">The ex style.</param>
        /// <exception cref="System.ArgumentNullException">control</exception>
        public static void SetExtendedStyle(Control control, ListViewExtendedStyles exStyle)
        {
            control.ThrowIfNull(nameof(control));

            ListViewExtendedStyles styles =
                (ListViewExtendedStyles)NativeMethods.SendMessage(control.Handle, (int)ListViewMessages.GetExtendedStyle,
                                                                  IntPtr.Zero, IntPtr.Zero);

            styles |= exStyle;
            NativeMethods.SendMessage(control.Handle, (int)ListViewMessages.SetExtendedStyle, IntPtr.Zero, (IntPtr)styles);
        }
Esempio n. 4
0
        /// <summary>
        /// Enables the double buffer.
        /// </summary>
        /// <param name="control">The control.</param>
        /// <exception cref="System.ArgumentNullException">control</exception>
        public static void EnableDoubleBuffer(Control control)
        {
            control.ThrowIfNull(nameof(control));

            // read current style
            ListViewExtendedStyles styles =
                (ListViewExtendedStyles)NativeMethods.SendMessage(control.Handle, (int)ListViewMessages.GetExtendedStyle,
                                                                  IntPtr.Zero, IntPtr.Zero);

            // enable double buffer and border select
            styles |= ListViewExtendedStyles.DoubleBuffer | ListViewExtendedStyles.BorderSelect;
            // write new style
            NativeMethods.SendMessage(control.Handle, (int)ListViewMessages.SetExtendedStyle, IntPtr.Zero, (IntPtr)styles);
        }
Esempio n. 5
0
        /// <summary>
        /// Sets the extended style.
        /// </summary>
        /// <param name="control">The control.</param>
        /// <param name="exStyle">The ex style.</param>
        /// <exception cref="System.ArgumentNullException">control</exception>
        public static void SetExtendedStyle(Control control, ListViewExtendedStyles exStyle)
        {
            control.ThrowIfNull(nameof(control));

            ListViewExtendedStyles styles =
                (ListViewExtendedStyles)NativeMethods.SendMessage(control.Handle, (int)ListViewMessages.GetExtendedStyle,
                                                                  IntPtr.Zero, IntPtr.Zero);
            styles |= exStyle;
            NativeMethods.SendMessage(control.Handle, (int)ListViewMessages.SetExtendedStyle, IntPtr.Zero, (IntPtr)styles);
        }
Esempio n. 6
0
        public static void SetListViewExtendedStyle(IntPtr HWND, ListViewExtendedStyles exStyle, int stylesint)
        {
            ListViewExtendedStyles styles;
            styles = (ListViewExtendedStyles)SendMessage(HWND, (int)ListViewMessages.GetExtendedStyle, 0, 0);
            styles |= exStyle;
            if (stylesint == -1)
            {

                SendMessage(HWND, (int)ListViewMessages.SetExtendedStyle, 0, (int)styles);
            }
            if (stylesint == 0)
            {
                SendMessage(HWND, (int)ListViewMessages.SetExtendedStyle, -1, 0);
            }

        }