當前位置: 首頁>>代碼示例>>C#>>正文


C# Forms.DrawListViewColumnHeaderEventArgs類代碼示例

本文整理匯總了C#中System.Windows.Forms.DrawListViewColumnHeaderEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# DrawListViewColumnHeaderEventArgs類的具體用法?C# DrawListViewColumnHeaderEventArgs怎麽用?C# DrawListViewColumnHeaderEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DrawListViewColumnHeaderEventArgs類屬於System.Windows.Forms命名空間,在下文中一共展示了DrawListViewColumnHeaderEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnDrawColumnHeader

 protected override void OnDrawColumnHeader(DrawListViewColumnHeaderEventArgs e)
 {
     base.OnDrawColumnHeader(e);
     if (e.ColumnIndex == 0)
     {
         var headerCheckBox = new CheckBox {Text = "", Visible = true};
         SuspendLayout();
         e.DrawBackground();
         headerCheckBox.BackColor = Color.Transparent;
         headerCheckBox.UseVisualStyleBackColor = true;
         headerCheckBox.BackgroundImage = Resources.ListViewHeaderCheckboxBackgroud;
         headerCheckBox.SetBounds(e.Bounds.X, e.Bounds.Y,
                                  headerCheckBox.GetPreferredSize(new Size(e.Bounds.Width, e.Bounds.Height)).
                                      Width,
                                  headerCheckBox.GetPreferredSize(new Size(e.Bounds.Width, e.Bounds.Height)).
                                      Height);
         headerCheckBox.Size =
             new Size(headerCheckBox.GetPreferredSize(new Size(e.Bounds.Width - 1, e.Bounds.Height)).Width + 1,
                      e.Bounds.Height);
         headerCheckBox.Location = new Point(4, 0);
         Controls.Add(headerCheckBox);
         headerCheckBox.Show();
         headerCheckBox.BringToFront();
         e.DrawText(TextFormatFlags.VerticalCenter | TextFormatFlags.Left);
         headerCheckBox.CheckedChanged += OnHeaderCheckboxCheckedChanged;
         ResumeLayout(true);
     }
     else
     {
         e.DrawDefault = true;
     }
 }
開發者ID:luowei98,項目名稱:RobertLw,代碼行數:32,代碼來源:ListViewHeaderCheckboxEx.cs

示例2: OnDrawColumnHeader

        protected override void OnDrawColumnHeader(DrawListViewColumnHeaderEventArgs e)
        {

            e.DrawDefault = true;
            base.OnDrawColumnHeader(e);

        }
開發者ID:yqMac,項目名稱:School,代碼行數:7,代碼來源:ListViewEx.cs

示例3: HandleDrawHeader

 private static void HandleDrawHeader(object sender, DrawListViewColumnHeaderEventArgs e)
 {
     e.Graphics.FillRectangle(new SolidBrush(oRAColours.Colour_BG_P0), e.Bounds);
     e.Graphics.DrawLine(new Pen(oRAColours.Colour_BG_P1), e.Bounds.X + e.Bounds.Width - 1, e.Bounds.Y, e.Bounds.X + e.Bounds.Width - 1, e.Bounds.Height - 1);
     e.Graphics.DrawLine(new Pen(oRAColours.Colour_BG_P1), e.Bounds.Left, e.Bounds.Bottom - 1, e.Bounds.Right - 1, e.Bounds.Bottom - 1);
     e.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
     e.Graphics.DrawString(e.Header.Text, oRAFonts.Font_Description, new SolidBrush(oRAColours.Colour_Text_H), e.Bounds.Left + e.Bounds.Width / 2 - e.Graphics.MeasureString(e.Header.Text, oRAFonts.Font_Description).Width / 2, e.Bounds.Top + e.Bounds.Height / 2 - e.Graphics.MeasureString(e.Header.Text, oRAFonts.Font_Description).Height / 2);
 }
開發者ID:smoogipooo,項目名稱:osu-Replay-Analyzer,代碼行數:8,代碼來源:CustomListView.cs

示例4: OnDrawColumnHeader

        protected override void OnDrawColumnHeader(DrawListViewColumnHeaderEventArgs e)
        {
            base.OnDrawColumnHeader(e);
            e.DrawBackground();
            e.DrawText();

            //e.BackColor = System.Drawing.Color.AliceBlue;
        }
開發者ID:kener1985,項目名稱:MyGitHubProj,代碼行數:8,代碼來源:MyListView.cs

示例5: OnDrawColumnHeader

		protected override void OnDrawColumnHeader(DrawListViewColumnHeaderEventArgs e)
		{
			e.Graphics.FillRectangle(new SolidBrush(SkinManager.GetApplicationBackgroundColor()), new Rectangle(e.Bounds.X, e.Bounds.Y, Width, e.Bounds.Height));
			e.Graphics.DrawString(e.Header.Text, 
				SkinManager.ROBOTO_MEDIUM_10, 
				SkinManager.GetSecondaryTextBrush(),
				new Rectangle(e.Bounds.X + ITEM_PADDING, e.Bounds.Y + ITEM_PADDING, e.Bounds.Width - ITEM_PADDING * 2, e.Bounds.Height - ITEM_PADDING * 2), 
				getStringFormat());
		}
開發者ID:DevinPower,項目名稱:MaterialSkin,代碼行數:9,代碼來源:MaterialListView.cs

示例6: SkinableListView_DrawColumnHeader

 void SkinableListView_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
 {
     e.Graphics.FillRectangle(new SolidBrush(this.BackColor), e.Bounds.X, 0, this.Width, e.Bounds.Height);
     using (var headerFont = new Font(this.Font.Name, 9, FontStyle.Regular))
     {
         e.Graphics.DrawRectangle(new Pen(new SolidBrush(Color.FromArgb(50, 255, 255, 255))), e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height-1);
         e.Graphics.DrawString(e.Header.Text, headerFont,
             new SolidBrush(this.ForeColor),  e.Bounds.X+3, e.Bounds.Y+4);
     }
 }
開發者ID:Jeidai,項目名稱:VisualSAIStudio,代碼行數:10,代碼來源:SkinableListView.cs

示例7: lvTables_DrawColumnHeader

        private void lvTables_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
        {
            //if (e.ColumnIndex == 0)
            //{
            //    TextFormatFlags flags = TextFormatFlags.LeftAndRightPadding;
            //    e.DrawBackground();

            //    //CheckBoxRenderer.DrawCheckBox(e.Graphics, ClientRectangle.Location, System.Windows.Forms.VisualStyles.CheckBoxState.UncheckedNormal); 
            //    CheckBoxRenderer.DrawCheckBox(e.Graphics, ClientRectangle.Location, Rectangle.Empty, "", this.Font,
            //                                  TextFormatFlags.HorizontalCenter, false, CheckBoxState.CheckedHot);

            //    e.DrawText(flags);
            //}
        }
開發者ID:bincle,項目名稱:Beinet.cn.Tools,代碼行數:14,代碼來源:MainForm.cs

示例8: HiddenWindowsListView_DrawColumnHeader

        private void HiddenWindowsListView_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
        {
            switch (e.ColumnIndex)
            {
                case 1:
                    e.DrawBackground();
                    e.Graphics.AddImage(e.Bounds, ActionResource.lockwindow_small);
                    break;

                case 2:
                    e.DrawBackground();
                    e.Graphics.AddImage(e.Bounds, ActionResource.tack_small);
                    break;

                default:
                    e.DrawDefault = true;
                    break;
            }
        }
開發者ID:priestofpsi,項目名稱:Hide-My-Window,代碼行數:19,代碼來源:HiddenWindowsListView.cs

示例9: HistoryListView_DrawColumnHeader

 void HistoryListView_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
 {
     e.DrawDefault = true;
 }
開發者ID:iwaim,項目名稱:growl-for-windows,代碼行數:4,代碼來源:HistoryListView.cs

示例10: lsvMods_DrawColumnHeader

 private void lsvMods_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
 {
     e.DrawDefault = true;
 }
開發者ID:aa2g,項目名稱:AA2Install,代碼行數:4,代碼來源:formMain.cs

示例11: dataSelectionList_DrawColumnHeader

 private void dataSelectionList_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
 {
     e.DrawDefault = true;
 }
開發者ID:dadelcarbo,項目名稱:StockAnalyzer,代碼行數:4,代碼來源:StockIndicatorSelectorDialog.cs

示例12: SortableListView_DrawColumnHeader

        void SortableListView_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
        {
            bool fSorted = (this._sortColumn == e.ColumnIndex);

            if (fSorted)
            {
                e.DrawBackground();
                e.DrawText(TextFormatFlags.VerticalCenter | TextFormatFlags.EndEllipsis);

                //如果是排序,並且圖片不為空,那麽繪製圖標
                if (fSorted && (_imageAscending != null) && (this._imageDescending != null))
                {
                    Point ptImage = new Point(e.Bounds.Left + (int)e.Graphics.MeasureString(e.Header.Text + "XY", e.Font).Width, (e.Bounds.Top + e.Bounds.Bottom - _imageAscending.Height) / 2);
                    e.Graphics.DrawImage((this._sortOrder > 0) ? _imageAscending : _imageDescending, ptImage);
                }

                this.Refresh();
            }
            else
            {
                e.DrawDefault = true;
            }
        }
開發者ID:Andy-Yin,項目名稱:MY_OA_RM,代碼行數:23,代碼來源:SortableListView.cs

示例13: SledTtyListViewDrawColumnHeader

 private void SledTtyListViewDrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
 {
     e.DrawDefault = true;
 }
開發者ID:arsaccol,項目名稱:SLED,代碼行數:4,代碼來源:SledTtyListView.cs

示例14: LstChangesDrawColumnHeader

 private void LstChangesDrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
 {
     e.DrawDefault = true;
 }
開發者ID:arsaccol,項目名稱:SLED,代碼行數:4,代碼來源:SledProjectModifiedForm.cs

示例15: OnDrawColumnHeader

 protected override void OnDrawColumnHeader(DrawListViewColumnHeaderEventArgs e)
 {
     base.OnDrawColumnHeader(e);
 }
開發者ID:tenshino,項目名稱:RainstormStudios,代碼行數:4,代碼來源:ctrlFixedColumnListView.cs


注:本文中的System.Windows.Forms.DrawListViewColumnHeaderEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。