随笔分类 - C# ListView
摘要:/* * 保存原理 * 将LISTVIEW视为一行一行的字符串 * 将所有的行合并成一个字符串 然后保存为TXT文件 * * 而每行又是由 几个 子项组成,先把子项连接成字符串 * 2019年11月27日 18:03:17 */
阅读全文
摘要:功能 添加、删除、修改选中的项、上移、下移、清空、保存列表、加载列表、判断内容是否重复、查找、模糊查找、取消选择、上一条、下一条、第一条、最后一条
阅读全文
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.IO;using System.Runtime.InteropServices;namespace WindowsFormsApplication2{ public partial class Form1 : For...
阅读全文
摘要:当ListView多选时返回第一次选中的项索引正确定义一个变量=-1 表示第一次没选任何一项privateintFirstSelectedIndex=-1;更新FirstSelectedIndex的值一定要放在Mouse_Click放在 listView1_SelectedIndexChanged或listView1_ItemSelectionChanged无效privatevoidlistView1_MouseClick(objectsender,MouseEventArgse){intcount=listView1.SelectedItems.Count;if(count>0){in
阅读全文
摘要:using System.Runtime.InteropServices; private const int WS_HSCROLL = 0x100000;private const int WS_VSCROLL = 0x200000;private const int GWL_STYLE = (-16); [DllImport("user32.dll")] priv...
阅读全文