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


C# GridEntry.PaintValue方法代码示例

本文整理汇总了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);
        }
开发者ID:mind0n,项目名称:hive,代码行数:21,代码来源:PropertyGridView.cs

示例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);
		}
开发者ID:nlhepler,项目名称:mono,代码行数:33,代码来源:PropertyGridView.cs


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