Question: For the last few days i have been trying to figure out the best way to get AutomationElement for a specific control in a vb6 application.

My initial way of doing so was by doing a search with the following condition:
new PropertyCondition(AutomationElement.NameProperty, *controlName*)

I was under the assumption that this was working correctly for about a week in a little test VB6 application.

but i few days ago i realized something... when i dragged a vb6 textbox into the form, the 'Name' property **and** 'Text' property were both set to 'Text1'

So when i searched with:
new PropertyCondition(AutomationElement.NameProperty, 'Text1')  

it return the correct element, but if i then went and set the 'Text' property to '' the same search would bring nothing back.

**Question:** Has anyone found a way to get a AutomationElement based on a the VB6 control name

**What i have tried:**

1. getting the MSAA equivalent interface and looking at the 'Name' property - Result: ''
<http://msdn.microsoft.com/en-us/library/windows/desktop/dd318490%28v=vs.85%29.aspx>
2. getting the control based on other properties (AutomationId, RuntimeId) - Result: AutomationId - not all controls seem to have this property available - RuntimeId - changes each time the app runs
3. I have looked at alot of different sites the main one is listed below - while some say they have manage to get it working - i don't believe i can see how they do it.. or i just dont understand it :$

<http://blogs.msdn.com/b/brianmcm/archive/2006/01/17/getting-the-winforms-id-of-a-control.aspx> 

While i have access to the demo app, i will not access to the production app as that has been created by a third party.

What i plan on doing from here is to get the Automation element based on their position on the form.. 

Thank you

Answer: 
Try:

```
return ((ckbx1.IsChecked ?? false) ||
        (ckbx2.IsChecked ?? false) ||
        ...

```
You can use `GetValueOrDefault()` to get either the value, or `false`.

```
private bool AtLeastOnePlatypusChecked()
{
    return ((ckbx1.IsChecked.GetValueOrDefault()) ||
            (ckbx2.IsChecked.GetValueOrDefault()) ||
            (ckbx3.IsChecked.GetValueOrDefault()) ||
            (ckbx4.IsChecked.GetValueOrDefault()));
}

```