本文整理汇总了C#中System.Windows.Controls.TextBox.SizeTo方法的典型用法代码示例。如果您正苦于以下问题:C# TextBox.SizeTo方法的具体用法?C# TextBox.SizeTo怎么用?C# TextBox.SizeTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.TextBox
的用法示例。
在下文中一共展示了TextBox.SizeTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplicationCanvas
public ApplicationCanvas()
{
r.Fill = Brushes.Red;
r.Opacity = 0.2;
r.AttachTo(this);
r.MoveTo(8, 8);
this.SizeChanged += (s, e) => r.SizeTo(this.Width - 16.0, this.Height - 16.0);
var f = new TextBox().AttachTo(this).MoveTo(8 + 4, 64);
this.SizeChanged += (s, e) => f.SizeTo(this.Width - 16.0 - 4, 24);
var t = new AnimatedToolbarCanvas();
t.AttachTo(this);
t.MoveTo(8, 8);
t.ItemClicked +=
SourceItem =>
{
f.Text = "" + SourceItem.Tag;
};
#region More
var c = 0;
Action More =
delegate
{
c++;
t.Items.Add(
new AnimatedToolbarCanvas.AnimatedToolbarItem
{
Image = new Avalon.Images.SolutionProjectDependentUpon(),
Tag = "hello world (" + c + ")"
}
);
};
#endregion
More();
5000.AtInterval(More);
r.MouseLeftButtonUp +=
delegate
{
More();
};
}
示例2: OrcasAvalonApplicationCanvas
//.........这里部分代码省略.........
))
{
InfoOverlayShadowOpacity.Opacity = 0.8;
InfoOverlayText.Text = "You won!\n\n:)";
ResetOverlay.AttachTo(TouchOverlay);
if (AtWin != null)
AtWin();
return;
}
t.TouchOverlay.Hide();
100.AtDelay(
delegate
{
AI();
t.TouchOverlay.Show();
if (Tiles.Any(
k =>
{
if (k.Value != -1)
return false;
return k.IsUnderAttack(-1, 4);
}
))
{
InfoOverlayShadowOpacity.Opacity = 0.8;
InfoOverlayText.Text = "You lost!\n\n:(";
ResetOverlay.AttachTo(TouchOverlay);
if (AtLoss != null)
AtLoss();
return;
}
}
);
};
};
var TileContainer = new Canvas().AttachTo(this);
#region build board
for (int x = 0; x < Intersections; x++)
for (int y = 0; y < Intersections; y++)
{
var t = new Tile(x, y);
t.Container.AttachTo(TileContainer);
t.TouchOverlay.AttachTo(TouchOverlay);
Tiles[x + y * Intersections] = t;
Tiles_WithEvents(t);
}
#endregion
#region add logo
var img = new com.abstractatech.gomoku.Avalon.Images.jsc
{
}.MoveTo(DefaultWidth - 96, DefaultHeight - 96).AttachTo(TileContainer);
#endregion
ResetOverlay.AttachTo(TouchOverlay);
InfoOverlay.AttachTo(this);
TouchOverlay.AttachTo(this);
this.SizeChanged +=
delegate
{
TileContainer.MoveTo(
(this.Width - DefaultWidth) /2,
(this.Height - DefaultHeight) /2
);
TouchOverlay.MoveTo(
(this.Width - DefaultWidth) / 2,
(this.Height - DefaultHeight) / 2
);
ResetOverlay.SizeTo(this.Width, this.Height);
InfoOverlay.SizeTo(this.Width, this.Height);
InfoOverlayShadow.SizeTo(this.Width, this.Height);
//TouchOverlay.SizeTo(this.Width, this.Height);
InfoOverlayText.MoveTo(0, (this.Height - 180) / 2);
InfoOverlayText.SizeTo(this.Width, 180);
};
}