本文整理汇总了C#中Application.setMargin方法的典型用法代码示例。如果您正苦于以下问题:C# Application.setMargin方法的具体用法?C# Application.setMargin怎么用?C# Application.setMargin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application
的用法示例。
在下文中一共展示了Application.setMargin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main(string[] args)
{
Application app = new Application(null, null);
app.setMargin(new Margin(10));
app.setLayout(new VBoxLayout());
Dialog dialog1 = new Dialog("Dialog 1", Dialog.ButtonOption.NoButtonOption);
ToolButton button1 = new ToolButton("Show dialog 1");
button1.connectClick(new DelegateNotify(dialog1.execute));
app.addWidget(button1);
Dialog dialog2 = new Dialog("Dialog 2", Dialog.ButtonOption.CancelButtonOption);
ToolButton button2 = new ToolButton("Show dialog 2");
button2.connectClick(new DelegateNotify(dialog2.execute));
app.addWidget(button2);
Dialog dialog3 = new Dialog("Dialog 3", Dialog.ButtonOption.OKCancelButtonOption);
ToolButton button3 = new ToolButton("Show dialog 3");
button3.connectClick(new DelegateNotify(dialog3.execute));
app.addWidget(button3);
Dialog dialog4 = new Dialog("Dialog 4", Dialog.ButtonOption.YesNoCancelButtonOption);
ToolButton button4 = new ToolButton("Show dialog 4");
button4.connectClick(new DelegateNotify(dialog4.execute));
app.addWidget(button4);
app.exec();
}
示例2: Main
public static void Main(string[] args)
{
Application app = new Application(null, null);
app.setMargin(new Margin(10));
app.setLayout(new VBoxLayout());
app.addWidget(new CheckBox("Select"));
app.addWidget(new PushButton("PushButton"));
app.addWidget(new RadioButton("Option 1"));
app.addWidget(new RadioButton("Option 2"));
app.addWidget(new RadioButton("Option 3"));
app.addWidget(new ToolButton("ToolButton"));
app.exec();
}