Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help needed: Set DefaultButton for dialog
#5
Code:
Copy      Help
// 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);


Messages In This Thread
RE: Help needed: Set DefaultButton for dialog - by Gintaras - 08-30-2023, 04:55 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)