开发者

UI button is enabled

how to check any UI button is enabled and visible in Lua. Suppose you get a control any UI button. Now we want to check if the button is Visible, Enabled or MovedToObject

Suppose you have a button creation code in C# and you are writing a Lua script as you have automation id and main application window title

Now I am able to get control on a button. I can click on that button through Lua script and ge开发者_运维百科t parent of that button control by below code. I need to know how can I check from Lua script is it visible or enabled


Assuming you are using LuaInterface to connect Lua and CLR, you could make your button object globally available in Lua:

luaInstance["ButtonName"] = buttonInstance;

Then in Lua script:

isEnabled = ButtonName.IsEnabled
isVisible = ButtonName.IsVisible

(Not tested; I just started playing with LuaInterface.)


if imagename.isvisible==true then

--print image is visible

else

--print image is not visible

end

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜