当前位置: 首页>>代码示例>>C#>>正文


C# DrawListViewColumnHeaderEventArgs.DrawText方法代码示例

本文整理汇总了C#中System.Windows.Forms.DrawListViewColumnHeaderEventArgs.DrawText方法的典型用法代码示例。如果您正苦于以下问题:C# DrawListViewColumnHeaderEventArgs.DrawText方法的具体用法?C# DrawListViewColumnHeaderEventArgs.DrawText怎么用?C# DrawListViewColumnHeaderEventArgs.DrawText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.DrawListViewColumnHeaderEventArgs的用法示例。


在下文中一共展示了DrawListViewColumnHeaderEventArgs.DrawText方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
        {
            base.OnDrawColumnHeader(e);
            e.DrawBackground();
            e.DrawText();

            //e.BackColor = System.Drawing.Color.AliceBlue;
        }
开发者ID:kener1985,项目名称:MyGitHubProj,代码行数:8,代码来源:MyListView.cs

示例3: 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

示例4: currentList_DrawColumnHeader

		/// <summary>
		/// Owner draw requires drawing the column header as well as the list items.  See LT-7007.
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		void currentList_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
		{
			e.DrawBackground();
			e.DrawText();
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:10,代码来源:ConfigureInterlinDialog.cs

示例5: ListView_EnabledEvents_DrawColumnHeader

 private void ListView_EnabledEvents_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
 {
     e.Graphics.FillRectangle(Brushes.GreenYellow, e.Bounds);
     e.DrawText();
     e.DrawDefault = true;
 }
开发者ID:nhannhan159,项目名称:PAT,代码行数:6,代码来源:SimulationForm.cs

示例6: DrawColumnHeader

 private void DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
 {
     e.DrawDefault = true;
     e.DrawBackground();
     e.DrawText();
 }
开发者ID:khoavnguyen,项目名称:cs333,代码行数:6,代码来源:DisplayForm.cs

示例7: ActionListView_DrawColumnHeader

 private void ActionListView_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
 {
     e.Graphics.FillRectangle(Brushes.White, e.Bounds);	//采用特定颜色绘制标题列
     e.DrawText();
 }
开发者ID:sbhhbs,项目名称:DBDesign-Tongji,代码行数:5,代码来源:ServiceInfo.cs

示例8: listView_DrawColumnHeader

 private void listView_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
 {
     e.DrawBackground();
     e.DrawText();
 }
开发者ID:oojjrs,项目名称:Nuri4,代码行数:5,代码来源:TextForm.cs

示例9: lvwTaskOfTheDay_DrawColumnHeader

 //private void editToolStripMenuItem_Click(object sender, EventArgs e)
 //{
 //    if (lvwTaskOfTheDay.SelectedItems.Count > 0)
 //    {
 //        foreach (ListViewItem lvi in lvwTaskOfTheDay.SelectedItems)
 //        {
 //            strRecurringID = lvi.Tag.ToString();
 //            strRecurringName = lvi.Text;
 //            strRecurringDes = lvi.SubItems[1].Text;
 //            strRecurringDate = lvi.SubItems[2].Text;
 //            strRecurringTime = lvi.SubItems[3].Text;
 //            strRecurringRepeat = lvi.SubItems[4].Text;
 //            frmNewRecurring.strFlag = "Edit";
 //            frmNewRecurring er = new frmNewRecurring();
 //            er.ShowDialog();
 //            LoadListView();
 //        }
 //    }
 //    else
 //    {
 //        MessageBox.Show("No item selected!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
 //    }
 //}
 private void lvwTaskOfTheDay_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
 {
     e.Graphics.FillRectangle(Brushes.LightGoldenrodYellow, e.Bounds);
     e.DrawText();
 }
开发者ID:minhnguyen31093,项目名称:Reminiscent,代码行数:28,代码来源:TaskOfTheDay.cs

示例10: ListView_DrawColumnHeader

 void ListView_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
 {
     e.Graphics.FillRectangle(Brushes.DimGray, e.Bounds);
     e.DrawText();
 }
开发者ID:patwaria,项目名称:pubcite,代码行数:5,代码来源:CitationsTab.cs

示例11: lvServerBrowser_DrawColumnHeader

 private void lvServerBrowser_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
 {
     e.DrawText();
 }
开发者ID:LaocheXe,项目名称:1stCavDiv-Launcher,代码行数:4,代码来源:ServerBrowser.cs


注:本文中的System.Windows.Forms.DrawListViewColumnHeaderEventArgs.DrawText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。