本文整理汇总了C#中TextBox.Layout方法的典型用法代码示例。如果您正苦于以下问题:C# TextBox.Layout方法的具体用法?C# TextBox.Layout怎么用?C# TextBox.Layout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextBox
的用法示例。
在下文中一共展示了TextBox.Layout方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
public void Render()
{
items = new List<CanvasItem>();
lifeLines = new List<LifeLine>();
Dictionary<string, LifeLine> llDict = new Dictionary<string, LifeLine>();
double x_where = 50.5;
double y_step = 25;
y_current = 0;
width = 0;
height = 0;
foreach(ElemObj elem in diagram.elements)
{
TextBox tb = new TextBox();
tb.YTop = 10.5;
tb.XCenter = x_where;
x_where += 100;
width += 100;
tb.Width = 70;
tb.BorderWidth = 3;
tb.Text = elem.text;
tb.Layout(cr);
items.Add(tb);
LifeLine ll = new LifeLine(elem.label, this, tb.XCenter, tb.Y1);
lifeLines.Add(ll);
llDict.Add(elem.label, ll);
if(tb.Y1 > YCurrent)
{
YCurrent = tb.Y1;
}
}
foreach(Step step in diagram.sequence)
{
if(step.amount == 0)
{
step.amount = (int)y_step;
}
YCurrent += step.amount;
foreach(LifeLine ll in lifeLines)
{
ll.BeforeActivations();
}
foreach(Activation a in step.activations)
{
LifeLine ll = llDict[a.label];
if(a.on)
{
ll.Activate();
}
else
{
ll.Deactivate();
}
}
foreach(LifeLine ll in lifeLines)
{
ll.AfterActivations();
}
foreach(Arrow arrow in step.arrows)
{
TextArrow ta;
LifeLine to = llDict[arrow.to];
LifeLine from = llDict[arrow.from];
if(to != from)
{
ta = new TextArrow();
bool right = to.X > from.X;
ta.Y0 = YCurrent;
if(right)
{
ta.X0 = from.XRightAfter;
ta.X1 = to.XLeftAfter;
ta.XText = from.XClearRight;
}
else
{
ta.X0 = from.XLeftAfter;
ta.X1 = to.XRightAfter;
ta.XText = from.XClearLeft;
}
}
else
{
SelfTextArrow sta = new SelfTextArrow();
sta.Y0 = YCurrent - 10;
sta.Y1 = YCurrent;
sta.X0 = from.XRightBefore;
sta.X0b = from.XRightAfter;
sta.X1 = from.XRightBefore + 30;
sta.XText = from.XClearRight;
//.........这里部分代码省略.........