Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/327.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在.net UIAutomation中是否可以设置控件模式属性?_C#_.net_Ui Automation - Fatal编程技术网

C# 在.net UIAutomation中是否可以设置控件模式属性?

C# 在.net UIAutomation中是否可以设置控件模式属性?,c#,.net,ui-automation,C#,.net,Ui Automation,我知道我可以通过UIAutomation和AutomationElement类中的GetCachedPropertyValue和GetCurrentPropertyValue方法检索应用程序中控件的属性。我想知道,是否可以使用UIAutomation将这些属性(如Textbox控件的背景色)设置为新值?如果没有,除了UIAutomation还有其他方法吗?所有这些内容都是只读的,只能由在同一应用程序中创建它们的线程更改,所以我不认为有任何方法可以从另一个进程更改它们。如果有一个模式支持它,比如V

我知道我可以通过UIAutomation和
AutomationElement
类中的
GetCachedPropertyValue
GetCurrentPropertyValue
方法检索应用程序中控件的属性。我想知道,是否可以使用UIAutomation将这些属性(如Textbox控件的背景色)设置为新值?如果没有,除了UIAutomation还有其他方法吗?

所有这些内容都是只读的,只能由在同一应用程序中创建它们的线程更改,所以我不认为有任何方法可以从另一个进程更改它们。如果有一个模式支持它,比如ValuePattern的SetValue或TogglePattern的Toggle,那么可以设置一些属性。类似于背景色的内容将无法通过UI自动化进行设置,因此您可能需要描述为什么要设置另一个应用程序的文本框的背景色。然后也许我们可以想出另一种方法来实现这个目标。我想验证并突出显示另一个应用程序文本框。假设我有权限直接写入内存(比如文本框背景色的位和字节),你会怎么想。