Modal property of form

Class library usage, coding and language questions.
bsing
Posts: 81
Joined: Tue Feb 07, 2012 5:25 am

Modal property of form

Post by bsing » Thu Dec 06, 2012 3:19 am

Hi there,

Just wanted to know ... when I use Ranorex Spy and track a form object, the list of properties includes a 'Modal' property indicating if the form is modal or not.

How can I access this 'Modal' value in code?

Basically I want to search through all forms and close all modal forms.


Brad.
Attachments
Modal.png
Modal.png (4.39 KiB) Viewed 799 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Modal property of form

Post by Support Team » Thu Dec 06, 2012 12:56 pm

Hello,

Could you please try to use the following code to achieve this:
var forms = Host.Local.Find<Form>("/form[@Modal='true']");			
foreach (var myForm in forms)
	myForm.Close();
Regards,
Markus (T)
.
Image

bsing
Posts: 81
Joined: Tue Feb 07, 2012 5:25 am

Re: Modal property of form

Post by bsing » Fri Dec 07, 2012 12:15 am

This works perfectly. Thanks Markus :)