08-30-2023, 04:55 AM
// script ""
using System.Windows;
using System.Windows.Controls;
var b = new wpfBuilder("Window").WinSize(400);
//add button Test and set default
b.R.AddButton("Test", 3);
((Button)b.Last).IsDefault = true;
//set OK non-default. Without it need to press Enter 2 times to close the window.
b.R.AddOkCancel(out var bOK, out _, out _);
bOK.IsDefault = false;
b.End();
if (!b.ShowDialog()) return;
print.it(b.ResultButton);
Help needed: Set DefaultButton for dialog