标题: 能否在程序运行时选定对象? [打印本页] 作者: hk_ella 时间: 2008-11-4 17:58 标题: 能否在程序运行时选定对象? Public Function SelectDeviceOpr(ActionName, DeviceName)
MatchFlag = 0
If Acti Then
With Window("企业客户端").Dialog("日志管理")
ElseIf Acti Then
With Window("企业客户端").Dialog("录像播放器").Dialog("录像查询")
End If
.WinButton("->").Click
ItemTotalCount = .Dialog("选择前端设备").WinTreeView("SysTreeView32").GetItemsCount
For i=1 To (ItemTotalCount-1)
NodeName = .Dialog("选择前端设备").WinTreeView("SysTreeView32").GetItemProperty( i, "text" )
If NodeName = dLogManageArray(0) Then
MatchFlag = 1
.Dialog("选择前端设备").WinTreeView("SysTreeView32").Select i
.Dialog("选择前端设备").WinButton("确定").Click
Exit For
End If
Next
If MatchFlag <> 1 Then
Reporter.ReportEvent micWarning, LogType, "The specific device is not exist"
.Dialog("选择前端设备").WinButton("取消").Click
.Close
End If
End with
SelectDeviceOpr = MatchFlag
End Function