本文整理汇总了C#中Label.SetStyle方法的典型用法代码示例。如果您正苦于以下问题:C# Label.SetStyle方法的具体用法?C# Label.SetStyle怎么用?C# Label.SetStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Label
的用法示例。
在下文中一共展示了Label.SetStyle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateChildren
override protected void CreateChildren()
{
base.CreateChildren();
#region Top label
Label label = new TitleLabel {Left = 20, Top = 20, StyleName = "title"};
AddChild(label);
new TextRotator
{
Delay = 5, // 5 seconds delay
Lines = new[]
{
"Absolute Layout Demo",
"Created with eDriven.Gui"/*,
"Author: Danko Kozar"*/
},
Callback = delegate(string line) { label.Text = line; }
}
.Start();
#endregion
#region Bottom label
Label label2 = new Label
{
Text = "[Resize your screen to see the layout changes]",
Bottom = 20,
HorizontalCenter = 0
};
label2.SetStyle("labelStyle", BlueLabelStyle.Instance);
AddChild(label2);
#endregion
Button btn1 = new Button
{
Left = 100,
Top = 100,
Width = 300,
Height = 300,
FocusEnabled = false,
Text = @"Left = 100,
Top = 100,
Width = 300,
Height = 300",
Tooltip = @"This is the tooltip
Nice, eh? :)",
SkinClass = typeof(ButtonSkin4),
Icon = ImageLoader.Instance.Load("Icons/star_big")
};
AddChild(btn1);
Button btn2 = new Button
{
Left = 500,
Right = 100,
Top = 100,
Height = 300,
MinWidth = 200,
FocusEnabled = false,
Text = @"Left = 500,
Right = 100,
Top = 100,
Height = 300,
MinWidth = 300",
Tooltip = @"This is the tooltip of the second button
(this one is constrained in width, so resizes with screen width)",
SkinClass = typeof(ButtonSkin4),
Icon = ImageLoader.Instance.Load("Icons/star_big")
};
AddChild(btn2);
Button btn3 = new Button
{
Left = 100,
Top = 500,
Bottom = 100,
Width = 300,
MinHeight = 200,
FocusEnabled = false,
Text = @"Left = 100,
Top = 500,
Bottom = 100,
Width = 300,
MinHeight = 300",
Tooltip = @"This is the tooltip of the third button
(this one is constrained in height, so resizes with screen height)",
SkinClass = typeof(ButtonSkin4),
Icon = ImageLoader.Instance.Load("Icons/star_big")
};
AddChild(btn3);
Button btn4 = new Button
{
Left = 500,
Right = 100,
Top = 500,
//.........这里部分代码省略.........