本文整理汇总了C#中Pad.ClientHeight方法的典型用法代码示例。如果您正苦于以下问题:C# Pad.ClientHeight方法的具体用法?C# Pad.ClientHeight怎么用?C# Pad.ClientHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pad
的用法示例。
在下文中一共展示了Pad.ClientHeight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Paint
public virtual void Paint(Pad pad, double minX, double maxX, double minY, double maxY)
{
float height = GetHeight(pad);
float width = GetWidth(pad);
float x = 0;
float y = 0;
switch (Position)
{
case ETextBoxPosition.TopRight:
x = pad.ClientX() + pad.ClientWidth() - X - width;
y = pad.ClientY() + Y;
break;
case ETextBoxPosition.TopLeft:
x = pad.ClientX() + X;
y = pad.ClientY() + Y;
break;
case ETextBoxPosition.BottomRight:
x = pad.ClientX() + pad.ClientWidth() - X - width;
y = pad.ClientY() + pad.ClientHeight() - Y - height;
break;
case ETextBoxPosition.BottomLeft:
x = pad.ClientX() + X;
y = pad.ClientY() + pad.ClientHeight() - Y - height;
break;
}
pad.Graphics.FillRectangle(new SolidBrush(BackColor), x, y, width, height);
if (BorderEnabled)
pad.Graphics.DrawRectangle(new Pen(BorderColor), x, y, width, height);
foreach (TTextBoxItem item in Items)
{
var h = pad.Graphics.MeasureString(item.Text, item.Font).Height;
pad.Graphics.DrawString(item.Text, item.Font, new SolidBrush(item.Color), x + 5, y);
y += 2 + h;
}
}
示例2: Paint
public virtual void Paint(Pad pad, double minX, double maxX, double minY, double maxY)
{
float height = GetHeight(pad);
float width = GetWidth(pad);
float x = 0f;
float y = 0f;
switch (Position)
{
case ETextBoxPosition.TopRight:
x = (float)(pad.ClientX() + pad.ClientWidth() - X) - width;
y = (float)(pad.ClientY() + Y);
break;
case ETextBoxPosition.TopLeft:
x = (float)(pad.ClientX() + X);
y = (float)(pad.ClientY() + Y);
break;
case ETextBoxPosition.BottomRight:
x = (float)(pad.ClientX() + pad.ClientWidth() - X) - width;
y = (float)(pad.ClientY() + pad.ClientHeight() - Y) - height;
break;
case ETextBoxPosition.BottomLeft:
x = (float)(pad.ClientX() + X);
y = (float)(pad.ClientY() + pad.ClientHeight() - Y) - height;
break;
}
pad.Graphics.FillRectangle((Brush)new SolidBrush(BackColor), x, y, width, height);
if (BorderEnabled)
pad.Graphics.DrawRectangle(new Pen(BorderColor), x, y, width, height);
foreach (TTextBoxItem ttextBoxItem in Items)
{
int num = (int)pad.Graphics.MeasureString(ttextBoxItem.Text, ttextBoxItem.Font).Height;
pad.Graphics.DrawString(ttextBoxItem.Text, ttextBoxItem.Font, (Brush)new SolidBrush(ttextBoxItem.Color), x + 5f, y);
y += (float)(2 + num);
}
}