DrawText() public method

public DrawText ( ) : void
return void
Ejemplo n.º 1
0
 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;
     }
 }
Ejemplo n.º 2
0
        protected override void OnDrawColumnHeader(DrawListViewColumnHeaderEventArgs e)
        {
            base.OnDrawColumnHeader(e);
            e.DrawBackground();
            e.DrawText();

            //e.BackColor = System.Drawing.Color.AliceBlue;
        }
Ejemplo n.º 3
0
        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;
            }
        }
Ejemplo n.º 4
0
		/// <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();
		}
Ejemplo n.º 5
0
 private void ListView_EnabledEvents_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
 {
     e.Graphics.FillRectangle(Brushes.GreenYellow, e.Bounds);
     e.DrawText();
     e.DrawDefault = true;
 }
Ejemplo n.º 6
0
 private void DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
 {
     e.DrawDefault = true;
     e.DrawBackground();
     e.DrawText();
 }
Ejemplo n.º 7
0
 private void ActionListView_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
 {
     e.Graphics.FillRectangle(Brushes.White, e.Bounds);	//采用特定颜色绘制标题列
     e.DrawText();
 }
Ejemplo n.º 8
0
 private void listView_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
 {
     e.DrawBackground();
     e.DrawText();
 }
Ejemplo n.º 9
0
 //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();
 }
Ejemplo n.º 10
0
 void ListView_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
 {
     e.Graphics.FillRectangle(Brushes.DimGray, e.Bounds);
     e.DrawText();
 }
Ejemplo n.º 11
0
 private void lvServerBrowser_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
 {
     e.DrawText();
 }