如何确定是否选中了复选框... [英] How to find out if a check box is checked...

查看:117
本文介绍了如何确定是否选中了复选框...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好吧


有一段时间我一直在研究UI测试应用程序。测试中的应用程序是用C#开发的,我的应用程序也是用C#开发的。我没有正在测试的应用程序的源代码,所以我使用Win API消息和方法。我遇到了以下问题:


测试中的应用程序包含一个复选框:


类:WindowsForms10.BUTTON

文字:有些文字

风格:有些风格


我拿到复选框后的手柄(我相信我我使用SendMessage来检索复选框状态:

展开 | 选择 | Wrap < span class =codeDivider> | 行号

解决方案

< blockquote>嗨tbarto,

我也找到同样的问题..如果你有它的解决方案,p租贴在这里...如果你给它一点时间,我将非常感激。



大家好/>

有一段时间我一直在研究UI测试应用程序。测试中的应用程序是用C#开发的,我的应用程序也是用C#开发的。我没有正在测试的应用程序的源代码,所以我使用Win API消息和方法。我遇到了以下问题:


测试中的应用程序包含一个复选框:


类:WindowsForms10.BUTTON

文字:有些文字

风格:有些风格


我拿到复选框后的手柄(我相信我我使用SendMessage来检索复选框状态:

展开 | 选择 | Wrap < span class =codeDivider> | 行号



嗨tbarto,

我也发现了同样的问题..如果你好你得到了它的解决方案,请在这里发布...如果你给它一些时间,我将非常感激。



你好amitjul


到目前为止,我还没有找到解决方案。我一直在研究其他一些问题。如果我能够得到解决方案,我会在这里发布。


问候



嗨tbarto,

我也找到同样的问题..如果你有解决方案,请在这里发布...如果你给它一些时间,我将非常感激。



Google搜索SendMessage,我发现Net复选框将始终返回0,因为它具有'0000000B'的扩展样式。他后来发布说他用AccessibleObjectFromWindow解决了这个问题,但由于文档很差,很难解决。他没有发布解决方案:mad:


AccessibleObjectFromWindow文档是 http://msdn2.microsoft.com/en-us/library/ms696137.aspx


最后,谷歌搜索AccessibleObjectFromWindow" ; C#"显示一些工作代码,但非常难看。如果这有助于您获得解决方案,请在此处发布。谢谢! --Sam


Hi everybody

For some time I have been working on an UI testing application. The application under test was developed in C#, and my application has been developed in C# as well. I do not have a source code of the application under test, so I use Win API messages and methods. I faced the following problem:

The application under test contains a check box:

Class: WindowsForms10.BUTTON
Text: "Some text"
Style: "Some styles"

After I get a handle to the check box ( I am sure I have the correct handle ) I use SendMessage to retrieve the check box state:

Expand|Select|Wrap|Line Numbers

解决方案

Hi tbarto,
Me too finding the same problem..if you got its solution, please post it here...i''ll be very thankful if you give some time for that.


Hi everybody

For some time I have been working on an UI testing application. The application under test was developed in C#, and my application has been developed in C# as well. I do not have a source code of the application under test, so I use Win API messages and methods. I faced the following problem:

The application under test contains a check box:

Class: WindowsForms10.BUTTON
Text: "Some text"
Style: "Some styles"

After I get a handle to the check box ( I am sure I have the correct handle ) I use SendMessage to retrieve the check box state:

Expand|Select|Wrap|Line Numbers


Hi tbarto,
Me too finding the same problem..if you got its solution, please post it here...i''ll be very thankful if you give some time for that.

Hi amitjul

As far as now I haven''t found the solution. I''ve been working on some other issues. If I am able to get the solution, I will post it here.

Regards


Hi tbarto,
Me too finding the same problem..if you got its solution, please post it here...i''ll be very thankful if you give some time for that.

Googling for SendMessage, I found out the the Net checkbox will always return 0 because it has an extended style of ''0000000B''. He later posted that he solved the problem with AccessibleObjectFromWindow but that it was difficult because of poor documentation. He did not post a solution :mad:

AccessibleObjectFromWindow documentation is http://msdn2.microsoft.com/en-us/library/ms696137.aspx

Finally, googling AccessibleObjectFromWindow "C#" shows some working code, but very ugly. If this helps you get a solution, please post it here. Thanks! --Sam


这篇关于如何确定是否选中了复选框...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆