Compact framework 有没有办法隐藏';System.Windows.Forms.ListBox()和#x27;边境

Compact framework 有没有办法隐藏';System.Windows.Forms.ListBox()和#x27;边境,compact-framework,listbox,Compact Framework,Listbox,有没有办法隐藏System.Windows.Forms.ListBox()border?如果有人感兴趣。。。这似乎奏效了。对紧凑型框架的另一个反对意见 public Form1() { InitializeComponent(); ShowBorder(listView1.Handle, false); } private void ShowBorder(IntPtr handle, bool bShow) {

有没有办法隐藏
System.Windows.Forms.ListBox()
border?

如果有人感兴趣。。。这似乎奏效了。对紧凑型框架的另一个反对意见

public Form1()
    {
        InitializeComponent();

        ShowBorder(listView1.Handle, false);
    }

    private void ShowBorder(IntPtr handle, bool bShow)
    {
        int style = GetWindowLong(handle, GWL_STYLE);
        if (bShow)
        {
            style |= WS_BORDER;
        }
        else
        {
            style &= ~WS_BORDER;
        }
        SetWindowLong(handle, GWL_STYLE, style);
        SetWindowPos(handle, IntPtr.Zero, 0, 0, 0, 0, 
                     SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
    }

    const int GWL_STYLE = -16;
    const int WS_BORDER = 0x00800000;
    const int SWP_NOSIZE = 0x1;
    const int SWP_NOMOVE = 0x2;
    const int SWP_FRAMECHANGED = 0x20;

    [DllImport("coredll.dll")]
    private static extern int GetWindowLong(IntPtr hWnd, int nIndex);

    [DllImport("coredll.dll")]
    private extern static void SetWindowLong(IntPtr hwnd, 
                                             int nIndex, int dwNewLong);

    [DllImport("coredll.dll")]
    private static extern bool SetWindowPos(IntPtr hwnd, 
                                            IntPtr hWndInsertAfter, 
                                            int x, int y, 
                                            int cx, int cy, int uflags);

如果有人感兴趣。。。这似乎奏效了。对紧凑型框架的另一个反对意见

public Form1()
    {
        InitializeComponent();

        ShowBorder(listView1.Handle, false);
    }

    private void ShowBorder(IntPtr handle, bool bShow)
    {
        int style = GetWindowLong(handle, GWL_STYLE);
        if (bShow)
        {
            style |= WS_BORDER;
        }
        else
        {
            style &= ~WS_BORDER;
        }
        SetWindowLong(handle, GWL_STYLE, style);
        SetWindowPos(handle, IntPtr.Zero, 0, 0, 0, 0, 
                     SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
    }

    const int GWL_STYLE = -16;
    const int WS_BORDER = 0x00800000;
    const int SWP_NOSIZE = 0x1;
    const int SWP_NOMOVE = 0x2;
    const int SWP_FRAMECHANGED = 0x20;

    [DllImport("coredll.dll")]
    private static extern int GetWindowLong(IntPtr hWnd, int nIndex);

    [DllImport("coredll.dll")]
    private extern static void SetWindowLong(IntPtr hwnd, 
                                             int nIndex, int dwNewLong);

    [DllImport("coredll.dll")]
    private static extern bool SetWindowPos(IntPtr hwnd, 
                                            IntPtr hWndInsertAfter, 
                                            int x, int y, 
                                            int cx, int cy, int uflags);