本文整理汇总了C#中GridColumn.GetCaption方法的典型用法代码示例。如果您正苦于以下问题:C# GridColumn.GetCaption方法的具体用法?C# GridColumn.GetCaption怎么用?C# GridColumn.GetCaption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GridColumn
的用法示例。
在下文中一共展示了GridColumn.GetCaption方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetColumnBestHeight
private int GetColumnBestHeight(GridViewInfo viewInfo, GridColumn column)
{
GridColumnInfoArgs ex = viewInfo.ColumnsInfo[column];
if (ex == null)
{
viewInfo.GInfo.AddGraphics(null);
ex = new GridColumnInfoArgs(viewInfo.GInfo.Cache, null);
try
{
ex.InnerElements.Add(new DrawElementInfo(new GlyphElementPainter(),
new GlyphElementInfoArgs(viewInfo.View.Images, 0, null),
StringAlignment.Near));
if (viewInfo.View.CanShowFilterButton(null))
{
ex.InnerElements.Add(viewInfo.Painter.ElementsPainter.FilterButton, new GridFilterButtonInfoArgs());
}
ex.SetAppearance(viewInfo.PaintAppearance.HeaderPanel);
ex.Caption = column.Caption;
ex.CaptionRect = new Rectangle(0, 0, column.Width - 20, 17);
}
finally
{
viewInfo.GInfo.ReleaseGraphics();
}
}
GraphicsInfo grInfo = new GraphicsInfo();
grInfo.AddGraphics(null);
ex.Cache = grInfo.Cache;
bool canDrawMore = true;
Size captionSize = CalcCaptionTextSize(grInfo.Cache, ex as HeaderObjectInfoArgs, column.GetCaption());
Size res = ex.InnerElements.CalcMinSize(grInfo.Graphics, ref canDrawMore);
res.Height = Math.Max(res.Height, captionSize.Height);
res.Width += captionSize.Width;
res = viewInfo.Painter.ElementsPainter.Column.CalcBoundsByClientRectangle(ex, new Rectangle(Point.Empty, res)).Size;
grInfo.ReleaseGraphics();
return res.Height;
}