• ListView控件显示 图片加文字说明 并且可以对滚动条进行控制


    using System;
    using System.Windows.Forms;
    using System.Runtime.InteropServices;

    namespace ListViewNav
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();

                ShowBorder(listView1.Handle, false);
                ShowBorder(listView2.Handle, false);
                ShowBorder(listView3.Handle, false);
            }

            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);

            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);
            }

        }
    }

     

  • 相关阅读:
    js将单个反斜杠转化为斜杠的问题
    HTML提供的6种空格
    JavaScript 内存管理
    JavaScript:4个常见的内存泄露
    正则多种匹配描述
    css3图片展示方式
    动态规划篇一:初见动态规划
    小球下落(Dropping Balls, Uva 679)
    破损的键盘(悲剧文本)(Broken Keyboard(a.k.a. Beiju Text),Uva 11988)
    铁轨(rails, ACM/ICPC CERC 1997,Uva 514)
  • 原文地址:https://www.cnblogs.com/huanghai223/p/2270726.html
Copyright © 2020-2023  润新知