This is a migrated thread and some comments may be shown as answers.

Windows modal

3 Answers 482 Views
Form
This is a migrated thread and some comments may be shown as answers.
André
Top achievements
Rank 1
André asked on 07 Oct 2011, 08:54 PM
I created a form and I want it to be modal, so users can't interact to what is behind this form. 

I've already tried to set "FormBorderStyle" to FixedDialog, but I still can interact with contents below this window.

Am I missing something?

Thanks!!

3 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 10 Oct 2011, 08:42 AM
Hi André,

Thank you for writing.

The only thing that you have to do in order to show a form as a modal form is to call its ShowDialog method instead of the Show method:
Form1 f = new Form1();
f.ShowDialog();

I hope that you find this information helpful.

All the best,
Stefan
the Telerik team

Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

0
Timothy
Top achievements
Rank 1
answered on 16 May 2018, 04:17 PM
That's the way I always understood it but that's not what's happening. Code execution does not wait for user response and returns a result of cancel even when there was no cancel button to click
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 17 May 2018, 09:59 AM
Hello,Timothy,     

When you show a form with using ShowDialog the code execution is interrupted at this point until you close the modal dialog. Note that pressing the close button in the title bar, "X", will return DialogResult.Cancel. However, you have other button that simply closes the form you can specify what DialogResult will be returned. I have attached a sample project for your reference.

I hope this information helps. If you have any additional questions, please let me know. 

Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Form
Asked by
André
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Timothy
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or