示例#1
0
        public bool RefreshListViewFromSqlIDWithParas(DataTable dt, SkinListView lv, string sqlid, Hashtable htPara)
        {
            bool ret = false;

            db = DB.GetMainDb();
            try
            {
                if (dt != null)
                {
                    dt.Dispose();
                }

                DataSet tempds = db.ExecuteSqlID(sqlid, htPara);
                if (dt == null)
                {
                    dt = new DataTable();
                }
                if (tempds != null && tempds.Tables.Count > 0)
                {
                    dt = tempds.Tables[0];
                }
                ShowDataTableInListView(dt, lv);
                ret = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                db.Close();
            }
            return(ret);
        }
示例#2
0
 }                                                                                                                                   //返回图片属性
 public ListView_show(List <ImageList> imageLists, SkinListView skinListView, SkinComboBox skinComboBox, SkinPictureBox skinPicture) //构造函数
 {
     this.imageLists   = imageLists;
     this.skinListView = skinListView;
     this.skinComboBox = skinComboBox;
     this.skinPicture  = skinPicture;
     this.skinListView.ItemActivate             += listView_ItemActivate;             //注册选择事件
     this.skinComboBox.SelectionChangeCommitted += comboBox_SelectionChangeCommitted; //注册事件
 }
示例#3
0
 /// <summary>
 /// SkinListView
 /// </summary>
 /// <param name="SLV"></param>
 public override void ListViewStyle(SkinListView SLV)
 {
     SLV.BackColor     = this.ChangeHexColorToDecimalColor("#FAE0F9");
     SLV.BorderColor   = this.ChangeHexColorToDecimalColor("#A7369F");
     SLV.ForeColor     = this.ChangeHexColorToDecimalColor("#400000");
     SLV.HeadColor     = this.ChangeHexColorToDecimalColor("#FE4AFB");
     SLV.RowBackColor1 = this.ChangeHexColorToDecimalColor("#FAE0F8");
     SLV.RowBackColor2 = this.ChangeHexColorToDecimalColor("#F7D9F7");
     SLV.SelectedColor = this.ChangeHexColorToDecimalColor("#FE4AF5");
 }
示例#4
0
 /// <summary>
 /// SkinListView
 /// </summary>
 /// <param name="SLV"></param>
 public override void ListViewStyle(SkinListView SLV)
 {
     SLV.BackColor     = this.ChangeHexColorToDecimalColor("#F1FAE0");
     SLV.BorderColor   = this.ChangeHexColorToDecimalColor("#36A749");
     SLV.ForeColor     = this.ChangeHexColorToDecimalColor("#1E4000");
     SLV.HeadColor     = this.ChangeHexColorToDecimalColor("#AAFE4A");
     SLV.RowBackColor1 = this.ChangeHexColorToDecimalColor("#F2FAE0");
     SLV.RowBackColor2 = this.ChangeHexColorToDecimalColor("#E8F7D9");
     SLV.SelectedColor = this.ChangeHexColorToDecimalColor("#B0FE4A");
 }
示例#5
0
 /// <summary>
 /// SkinListView
 /// </summary>
 /// <param name="SLV"></param>
 public override void ListViewStyle(SkinListView SLV)
 {
     SLV.BackColor     = this.ChangeHexColorToDecimalColor("#FAF8E1");
     SLV.BorderColor   = this.ChangeHexColorToDecimalColor("#A78B36");
     SLV.ForeColor     = this.ChangeHexColorToDecimalColor("#400000");
     SLV.HeadColor     = this.ChangeHexColorToDecimalColor("#FED14A");
     SLV.RowBackColor1 = this.ChangeHexColorToDecimalColor("#FAF8E1");
     SLV.RowBackColor2 = this.ChangeHexColorToDecimalColor("#F7F5D9");
     SLV.SelectedColor = this.ChangeHexColorToDecimalColor("#FED74A");
 }
示例#6
0
 /// <summary>
 /// SkinListView
 /// </summary>
 /// <param name="SLV"></param>
 public override void ListViewStyle(SkinListView SLV)
 {
     SLV.BackColor     = this.ChangeHexColorToDecimalColor("#EDEFF0");
     SLV.BorderColor   = this.ChangeHexColorToDecimalColor("#ACACAD");
     SLV.ForeColor     = this.ChangeHexColorToDecimalColor("#444445");
     SLV.HeadColor     = this.ChangeHexColorToDecimalColor("#DADADB");
     SLV.RowBackColor1 = this.ChangeHexColorToDecimalColor("#E4EAF2");
     SLV.RowBackColor2 = this.ChangeHexColorToDecimalColor("#D9E5F7");
     SLV.SelectedColor = this.ChangeHexColorToDecimalColor("#B8C4CE");
 }
示例#7
0
 /// <summary>
 /// SkinListView
 /// </summary>
 /// <param name="SLV"></param>
 public override void ListViewStyle(SkinListView SLV)
 {
     SLV.BackColor     = this.ChangeHexColorToDecimalColor("#E0EFFA");
     SLV.BorderColor   = this.ChangeHexColorToDecimalColor("#3667A7");
     SLV.ForeColor     = this.ChangeHexColorToDecimalColor("#010040");
     SLV.HeadColor     = this.ChangeHexColorToDecimalColor("#4AA1FE");
     SLV.RowBackColor1 = this.ChangeHexColorToDecimalColor("#E0EAFA");
     SLV.RowBackColor2 = this.ChangeHexColorToDecimalColor("#D9E5F7");
     SLV.SelectedColor = this.ChangeHexColorToDecimalColor("#4AADFE");
 }
示例#8
0
        public void InitView()
        {
            ServerInfo[] serverInfos    = parseServerInfo();
            SkinListView serverListView = mainForm.serverListView;

            //serverListView.Container.Add(mainForm.serverVBar);
            serverListView.Items.Clear();

            foreach (ServerInfo serverInfo in serverInfos)
            {
                ListViewItem viewItem = new ListViewItem(serverInfo.serverName);
                viewItem.Tag = serverInfo;
                serverListView.Items.Add(viewItem);
            }

            serverListView.ItemSelectionChanged += onItemSelectChanged;
//            serverListView.ItemChecked += onCheckServerItem;
        }
示例#9
0
        public void ShowDataTableInListView(DataTable dt, SkinListView lv)
        {
            lv.Clear();
            lv.AllowColumnReorder = true;  //用户可以调整列的位置
            lv.GridLines          = true;  //显示行与行之间的分隔线
            lv.FullRowSelect      = true;  //要选择就是一行
            lv.View        = View.Details; //定义列表显示的方式
            lv.Scrollable  = true;         //需要时候显示滚动条
            lv.MultiSelect = false;        // 不可以多行选择
            lv.HeaderStyle = ColumnHeaderStyle.Clickable;
            lv.View        = View.Details;
            int     RowCount, ColumnCount;
            DataRow dr = null;

            if (dt == null)
            {
                return;
            }
            RowCount    = dt.Rows.Count;
            ColumnCount = dt.Columns.Count;
            //添加列标题名
            for (int i = 0; i < ColumnCount; i++)
            {
                lv.Columns.Add(dt.Columns[i].Caption.Trim(), lv.Width / ColumnCount);
            }
            if (RowCount == 0)
            {
                return;
            }
            for (int i = 0; i < RowCount; i++)
            {
                dr = dt.Rows[i];
                lv.Items.Add(dr[0].ToString());
                for (int j = 1; j < ColumnCount; j++)
                {
                    lv.Items[i].SubItems.Add(dr[j].ToString());
                }
            }
        }
示例#10
0
 public abstract void ListViewStyle(SkinListView SLV);