本文整理汇总了C#中System.Windows.Forms.PropertyGridInternal.GridEntry.PaintValue方法的典型用法代码示例。如果您正苦于以下问题:C# GridEntry.PaintValue方法的具体用法?C# GridEntry.PaintValue怎么用?C# GridEntry.PaintValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.PropertyGridInternal.GridEntry
的用法示例。
在下文中一共展示了GridEntry.PaintValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawValue
private void DrawValue(System.Drawing.Graphics g, Rectangle rect, Rectangle clipRect, GridEntry gridEntry, object value, bool drawSelected, bool checkShouldSerialize, bool fetchValue, bool paintInPlace) {
GridEntry.PaintValueFlags paintFlags = GridEntry.PaintValueFlags.None;
if (drawSelected) {
paintFlags |= GridEntry.PaintValueFlags.DrawSelected;
}
if (checkShouldSerialize) {
paintFlags |= GridEntry.PaintValueFlags.CheckShouldSerialize;
}
if (fetchValue) {
paintFlags |= GridEntry.PaintValueFlags.FetchValue;
}
if (paintInPlace) {
paintFlags |= GridEntry.PaintValueFlags.PaintInPlace;
}
gridEntry.PaintValue(value, g, rect, clipRect, paintFlags);
}
示例2: DrawGridItemValue
private void DrawGridItemValue (GridEntry grid_item, PaintEventArgs pevent, int depth, Rectangle rect)
{
if (grid_item.PropertyDescriptor == null)
return;
int xLoc = SplitterLocation+ENTRY_SPACING;
if (grid_item.PaintValueSupported) {
pevent.Graphics.DrawRectangle (Pens.Black, SplitterLocation + ENTRY_SPACING,
rect.Y + 2, VALUE_PAINT_WIDTH + 1, row_height - ENTRY_SPACING*2);
grid_item.PaintValue (pevent.Graphics,
new Rectangle (SplitterLocation + ENTRY_SPACING + 1,
rect.Y + ENTRY_SPACING + 1,
VALUE_PAINT_WIDTH, row_height - (ENTRY_SPACING*2 +1)));
xLoc += VALUE_PAINT_INDENT;
}
Font font = this.Font;
if (grid_item.IsResetable || !grid_item.HasDefaultValue)
font = bold_font;
Brush brush = grid_item.IsReadOnly ? inactive_text_brush : SystemBrushes.ControlText;
string valueText = String.Empty;
if (!grid_item.IsMerged || grid_item.IsMerged && grid_item.HasMergedValue) {
if (grid_item.IsPassword)
valueText = new String (PASSWORD_PAINT_CHAR, grid_item.ValueText.Length);
else
valueText = grid_item.ValueText;
}
pevent.Graphics.DrawString (valueText, font,
brush,
new RectangleF (xLoc + ENTRY_SPACING, rect.Y + ENTRY_SPACING,
ClientRectangle.Width-(xLoc), row_height - ENTRY_SPACING*2),
string_format);
}