本文整理汇总了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;
}
}
示例2: OnDrawColumnHeader
protected override void OnDrawColumnHeader(DrawListViewColumnHeaderEventArgs e)
{
base.OnDrawColumnHeader(e);
e.DrawBackground();
e.DrawText();
//e.BackColor = System.Drawing.Color.AliceBlue;
}
示例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;
}
}
示例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();
}
示例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;
}
示例6: DrawColumnHeader
private void DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
{
e.DrawDefault = true;
e.DrawBackground();
e.DrawText();
}
示例7: ActionListView_DrawColumnHeader
private void ActionListView_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
{
e.Graphics.FillRectangle(Brushes.White, e.Bounds); //采用特定颜色绘制标题列
e.DrawText();
}
示例8: listView_DrawColumnHeader
private void listView_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
{
e.DrawBackground();
e.DrawText();
}
示例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();
}
示例10: ListView_DrawColumnHeader
void ListView_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
{
e.Graphics.FillRectangle(Brushes.DimGray, e.Bounds);
e.DrawText();
}
示例11: lvServerBrowser_DrawColumnHeader
private void lvServerBrowser_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
{
e.DrawText();
}