Exemplo n.º 1
0
 void DefineView()
 {
     LV = new MyListViewA(listView1);
     LV.SetDB(Global.con, "Labels");
     LV.ColumnWidths = new int[] { 0, 0, 0, 230, 65 };//列宽(默认80)
     LV.RowHeight    = 30;
     LV.RowColor     = Color.LightGray;
     LV.SetStyle("Cambria", 16, FontStyle.Bold);
     LV.QueryFields = "LabelID,GroupID,Path,LabelName as 标签名,LabelOrder as 序号";
     LV.Where("GroupID=" + GroupID);
     LV.OrderBy("LabelOrder");
     ShowData();
 }
Exemplo n.º 2
0
 void DefineView()
 {
     LB  = new MyListBox(listBox1, "select * from NoteGroups order by GroupOrder", "GroupName", "GroupID", Global.con);
     CBB = new MyComboBox(comboBox1, "select * from NoteGroups order by GroupOrder", "GroupName", "GroupID", Global.con);
     try { LB.SelectedIndex = 0; }
     catch { LB.SelectedIndex = -1; }
     //====
     LV = new MyListViewA(listView1);
     LV.SetDB(Global.con, "Notes");
     LV.ColumnWidths = new int[] { 0, 0, 0, 150, 220 };//列宽(默认80)
     LV.RowHeight    = 30;
     //LV.AlignCenter = true;
     LV.SetStyle("Cambria", 14, FontStyle.Bold);
     LV.QueryFields = "NoteID,GroupID,Content,TimeOfRevision as 修改时间,Title as 笔记标题";
     LV.OrderBy("TimeOfRevision desc");
     ShowData();
 }
Exemplo n.º 3
0
        void LVLoadA()
        {
            LVA = new MyListViewA(listView1);
            LVA.SetDB(conA, "Employees");
            //LVA.RowColor = Color.AntiqueWhite;//行色(默认白色)
            LVA.ColumnWidths = new int[] { 0, 80, 80 };//列宽(默认80)
            //LVA.RowHeight = 35;//行高(默认25)
            //LVA.AlignCenter = true;//对齐方式(默认靠左)
            LVA.SetStyle();
            //LVA.SetStyle("宋体", 16f, FontStyle.Bold);//设定样式2

            LVA.QueryFields = "EmployeeID as ID,LastName+FirstName as 姓名,TitleOfCourtesy as 尊称";//输出列控制
            //LVA.OrderBy("EmployeeID desc");//排序字段与排序方式(默认按首列升序)
            //LVA.Where("EmployeeID>2");//条件限制(默认无条件限制)
            //LVA.ClearWhere();//清除条件限制
            //LVA.ClearOrderBy();//重置排序方式
            //LVA.UseSpecialSQL("select EmployeeID as ID,LastName+FirstName as 姓名 from Employees");//使用自编SQL语句
            //LVA.AbandonSpecialSQL();//不使用自编SQL语句并清除掉
            LVA.ShowData();
            Console.WriteLine("载入条数:" + LVA.CountRows);//获取总行数(数据显示后更新)
        }