Example #1
0
        private Win_ListView MakeListView(int nAdapter, bool bDobuleClick)
        {
            Win_ListView _ListView = new Win_ListView();

            _ListView.SuspendLayout();
            ImageList dumImgList = new ImageList();

            dumImgList.ImageSize     = new System.Drawing.Size(1, 20);         //리스트 뷰 라인 간격 조절용
            _ListView.SmallImageList = dumImgList;

            //컬럼 만들기.
            System.Windows.Forms.ColumnHeader _Column1 = new System.Windows.Forms.ColumnHeader();
            _Column1.Text = "Name"; _Column1.Width = 300;
            System.Windows.Forms.ColumnHeader _Column2 = new System.Windows.Forms.ColumnHeader();
            _Column2.Text = "Type"; _Column2.Width = 100;
            System.Windows.Forms.ColumnHeader _Column3 = new System.Windows.Forms.ColumnHeader();
            _Column3.Text = "Value"; _Column3.Width = 80;
            _ListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { _Column1, _Column2, _Column3 });

            _ListView.BorderStyle   = System.Windows.Forms.BorderStyle.FixedSingle;
            _ListView.Dock          = System.Windows.Forms.DockStyle.Fill;
            _ListView.Font          = new System.Drawing.Font("굴림체", 9F);
            _ListView.FullRowSelect = true;
            _ListView.GridLines     = true;
            _ListView.OwnerDraw     = true;
            _ListView.Location      = new System.Drawing.Point(3, 3);
            _ListView.UseCompatibleStateImageBehavior = false;
            _ListView.View              = System.Windows.Forms.View.Details;
            _ListView.DrawColumnHeader += new System.Windows.Forms.DrawListViewColumnHeaderEventHandler(this.ListView_DrawColumnHeader);
            _ListView.DrawSubItem      += new System.Windows.Forms.DrawListViewSubItemEventHandler(this.ListView_DrawSubItem);
            if (bDobuleClick == true)
            {
                _ListView.DoubleClick += new System.EventHandler(this.ListView_Output_DoubleClick);
            }
            _ListView.ResumeLayout(false);
            return(_ListView);
        }
Example #2
0
        private Win_ListView MakeListView(int nAdapter)
        {
            Win_ListView _ListView = new Win_ListView();

            _ListView.SuspendLayout();
            ImageList dumImgList = new ImageList();

            dumImgList.ImageSize     = new System.Drawing.Size(1, 30);         //리스트 뷰 라인 간격 조절용
            _ListView.SmallImageList = dumImgList;

            //컬럼 만들기.
//          System.Windows.Forms.ColumnHeader _Column1 = new System.Windows.Forms.ColumnHeader();
//          _Column1.Text = "Name"; _Column1.Width = 230;
//          System.Windows.Forms.ColumnHeader _Column2 = new System.Windows.Forms.ColumnHeader();
//          _Column2.Text = "Addr"; _Column2.Width = 50;
//          System.Windows.Forms.ColumnHeader _Column3 = new System.Windows.Forms.ColumnHeader();
//          _Column3.Text = "SubAddr"; _Column3.Width = 60;
//          System.Windows.Forms.ColumnHeader _Column4 = new System.Windows.Forms.ColumnHeader();
//          _Column4.Text = "Val"; _Column4.Width = 80;
//          System.Windows.Forms.ColumnHeader _Column5 = new System.Windows.Forms.ColumnHeader();
//          _Column5.Text = "Cable"; _Column5.Width = 0;// 70;
//          System.Windows.Forms.ColumnHeader _Column6 = new System.Windows.Forms.ColumnHeader();
//          _Column6.Text = "Type"; _Column6.Width = 0;

            System.Windows.Forms.ColumnHeader _Column1 = new System.Windows.Forms.ColumnHeader();
            _Column1.Text = "Name"; _Column1.Width = 290;
            System.Windows.Forms.ColumnHeader _Column2 = new System.Windows.Forms.ColumnHeader();
            _Column2.Text = "Addr"; _Column2.Width = 80;
            System.Windows.Forms.ColumnHeader _Column3 = new System.Windows.Forms.ColumnHeader();
            _Column3.Text = "SubAddr"; _Column3.Width = 80;
            System.Windows.Forms.ColumnHeader _Column4 = new System.Windows.Forms.ColumnHeader();
            _Column4.Text = "Val"; _Column4.Width = 80;
            System.Windows.Forms.ColumnHeader _Column5 = new System.Windows.Forms.ColumnHeader();
            _Column5.Text = "Cable"; _Column5.Width = 0;// 70;
            System.Windows.Forms.ColumnHeader _Column6 = new System.Windows.Forms.ColumnHeader();
            _Column6.Text = "Type"; _Column6.Width = 0;

            _Column1.TextAlign = HorizontalAlignment.Center;
            _Column2.TextAlign = HorizontalAlignment.Center;
            _Column3.TextAlign = HorizontalAlignment.Center;
            _Column4.TextAlign = HorizontalAlignment.Center;
            _Column5.TextAlign = HorizontalAlignment.Center;
            _Column6.TextAlign = HorizontalAlignment.Center;

            _ListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { _Column1, _Column2, _Column3, _Column4, _Column5, _Column6 });

            _ListView.BorderStyle = System.Windows.Forms.BorderStyle.None;
            _ListView.Dock        = System.Windows.Forms.DockStyle.Fill;
            //_ListView.Font = new System.Drawing.Font("굴림체", 9F);
            _ListView.Font = new System.Drawing.Font("고딕", 9F);
//             _ListView.BackColor = Color.DimGray;
//             _ListView.BackColor = Color.FromArgb(50,50,50);
            _ListView.ForeColor     = Color.Black;
            _ListView.FullRowSelect = true;
            _ListView.GridLines     = false;
            _ListView.OwnerDraw     = true;
            _ListView.Location      = new System.Drawing.Point(3, 3);
            _ListView.UseCompatibleStateImageBehavior = false;
            _ListView.View              = System.Windows.Forms.View.Details;
            _ListView.DrawColumnHeader += new System.Windows.Forms.DrawListViewColumnHeaderEventHandler(this.ListView_DrawColumnHeader);
            _ListView.DrawSubItem      += new System.Windows.Forms.DrawListViewSubItemEventHandler(this.ListView_DrawSubItem);
            _ListView.DoubleClick      += new System.EventHandler(this.ListView_Output_DoubleClick);
            _ListView.ResumeLayout(false);
            return(_ListView);
        }