本文整理汇总了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;
}
}
示例2: OnDrawColumnHeader
protected override void OnDrawColumnHeader(DrawListViewColumnHeaderEventArgs e)
{
e.DrawDefault = true;
base.OnDrawColumnHeader(e);
}
示例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);
}
示例4: OnDrawColumnHeader
protected override void OnDrawColumnHeader(DrawListViewColumnHeaderEventArgs e)
{
base.OnDrawColumnHeader(e);
e.DrawBackground();
e.DrawText();
//e.BackColor = System.Drawing.Color.AliceBlue;
}
示例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());
}
示例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);
}
}
示例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);
//}
}
示例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;
}
}
示例9: HistoryListView_DrawColumnHeader
void HistoryListView_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
{
e.DrawDefault = true;
}
示例10: lsvMods_DrawColumnHeader
private void lsvMods_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
{
e.DrawDefault = true;
}
示例11: dataSelectionList_DrawColumnHeader
private void dataSelectionList_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
{
e.DrawDefault = true;
}
示例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;
}
}
示例13: SledTtyListViewDrawColumnHeader
private void SledTtyListViewDrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
{
e.DrawDefault = true;
}
示例14: LstChangesDrawColumnHeader
private void LstChangesDrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
{
e.DrawDefault = true;
}
示例15: OnDrawColumnHeader
protected override void OnDrawColumnHeader(DrawListViewColumnHeaderEventArgs e)
{
base.OnDrawColumnHeader(e);
}