How to hide button Close in ModernDialog

Apr 20, 2014 at 11:49 AM
I want to make moderndialog with no button close appear. How to achieve this ? And I want if I press enter in the form it not close automatically? If it Possible?
Apr 28, 2014 at 6:32 AM
Hi there,

Yes. That's possible. The ModernDialog has a Buttons property of type IEnumerable<Button> type. To remove buttons on the dialog, assign an empty array to it. You can also create your own set of buttons and assign them as an array to Buttons property.

By default, there're two buttons set to Buttons property, one for OK, the other for Cancel. The IsDefault property of the OK button is set to true, which means if you press ENTER, this button will be invoked. If you don't want this behavior, just obtain a reference of this button, and set its IsDefault to false. By the way, the Cancel button has its IsCancel property set to true, which means if you press ESC, this button will be invoked.

Hope that helps.
Apr 28, 2014 at 8:06 AM
Thanks.. it help me alot..