本文整理汇总了C#中Eto.Forms.Button.PerformClick方法的典型用法代码示例。如果您正苦于以下问题:C# Button.PerformClick方法的具体用法?C# Button.PerformClick怎么用?C# Button.PerformClick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Eto.Forms.Button
的用法示例。
在下文中一共展示了Button.PerformClick方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UnitTestSection
public UnitTestSection()
{
startButton = new Button { Text = "Start Tests", Size = new Size(200, 80) };
useTestPlatform = new CheckBox { Text = "Use Test Platform" };
var buttons = new StackLayout
{
Padding = new Padding(10),
Spacing = 5,
HorizontalContentAlignment = HorizontalAlignment.Center,
Items = { startButton, useTestPlatform }
};
if (Platform.Supports<TreeView>())
{
search = new SearchBox();
search.Focus();
search.KeyDown += (sender, e) =>
{
if (e.KeyData == Keys.Enter)
{
startButton.PerformClick();
e.Handled = true;
}
};
var timer = new UITimer();
timer.Interval = 0.5;
timer.Elapsed += (sender, e) =>
{
timer.Stop();
PopulateTree(search.Text);
};
search.TextChanged += (sender, e) => {
if (timer.Started)
timer.Stop();
timer.Start();
};
tree = new TreeView();
tree.Activated += (sender, e) =>
{
var item = (TreeItem)tree.SelectedItem;
if (item != null)
{
RunTests(item.Tag as CategoryFilter);
}
};
Content = new StackLayout
{
Spacing = 5,
HorizontalContentAlignment = HorizontalAlignment.Stretch,
Items = { buttons, search, new StackLayoutItem(tree, expand: true) }
};
}
else
Content = buttons;
startButton.Click += (s, e) => RunTests();
}