2013-07-25 64 views
1

我正在使用White编写一些基于UIAutomation库的文章C#,我想知道如何获得元素的实际值?我的意思是textbox,labelbuttonnumeric up-down的数值? AFAIK也没有像'GetValue'这样的方法。如何实现这一目标?从UI元素获取价值

+0

如果您正在使用WPF这种资源可以帮助:http://www.codeproject.com/Articles/34038/UI-Automation-Framework - 使用-WPF –

回答

0

。文本

Button.Text 
Label.Text 
Textbox.Text 

等等等等

0
//for textbox 
string your_needed_text1 = textBox1.text; 
//for button 
    string your_needed_text2 = Button1.text;