示例#1
0
        /// <summary>
        /// Hides the border of Listbox Control
        /// </summary>
        /// <param name="listBox"> listbox control object whose border is to be hidden</param>
        internal static void hideListBoxBorder(ListBox listbox)
        {
            IntPtr handle = listbox.Handle;
            int    style  = NativeWindowCommon.GetWindowLong(handle, NativeWindowCommon.GWL_STYLE);

            style &= ~NativeWindowCommon.WS_BORDER;
            NativeWindowCommon.SetWindowLong(handle, NativeWindowCommon.GWL_STYLE, style);
            NativeWindowCommon.SetWindowPos(handle, IntPtr.Zero, 0, 0, 0, 0, NativeWindowCommon.SWP_NOMOVE | NativeWindowCommon.SWP_NOSIZE | NativeWindowCommon.SWP_FRAMECHANGED);
        }
示例#2
0
 /// <summary> subclass the listbox - replace it's window proce
 /// </summary>
 void subclassListbox()
 {
     proc        = new MobileWndProc(WindowProc);
     OrigWndProc = (IntPtr)NativeWindowCommon.SetWindowLong(Handle, NativeWindowCommon.GWL_WNDPROC,
                                                            Marshal.GetFunctionPointerForDelegate(proc).ToInt32());
 }