Hello,
I am wondering if there is a way to check if the button exists on the Form.
I tried:
if (m_MyButton == null)
but I get Error CS0029: Cannot implicitly convert type 'Ranorex.Button' to 'bool'
Thanks!
Best way to check if a Button is missing (C#).
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Your code works perfectly well for me. If button m_ButtonOk is not found, null is returned and the if branch is executed. Do you still get a compile error?
Regards,
Alex
Ranorex Support Team
Ranorex 2.0 introduces new features that make automation a lot easier. Ranorex 2.0 code is more compact and even more readable than Ranorex 1.5 code. However, Ranorex 2.0 is not released, yet. There is a Technology Preview available, but it is not intended to be used in a productional environment due to stability issues.bebenin_s wrote:Would it be better to use Ranorex 2.0?
Regards,
Alex
Ranorex Support Team