How to Access Internal Properties and Methods of Run-Time .NET Windows Forms Objects

Advertisement:

Object property can be used to retrieve internal properties and activate internal methods of any .NET Windows Forms object in your application.
 
For example, you can set the focus to a particular button and change its caption using statements similar to the following:
Set theButton = SwfWindow(“frmWin”).SwfButton(“OK”).Object

theButton.SetFocus

theButton.Caption = “Yes”
The Object property is also useful for verifying the value of properties that are not available using a standard checkpoint.
 
When you use the Object property to retrieve arrays of structures, the Object property returns the COM wrapper of the system.array object. In your VBScript test or component steps, you can then use the system.array object to access the array members.
 
For example, suppose a button object in your application has a PointArray property, which is an array of Point structures. To access the first item in the PointArray property, you would use the following expression:
 
SwfWindow(“Form1″).SwfButton(“button1″).Object.PointArray.GetValue1(0)
If the same object had an IntArray property, which was an array of integers, you would use the following expression to access the first item in the IntArray property:
 
SwfWindow(“Form1″).SwfButton(“button1″).Object.IntArray(0)
Advertisement:

1 comment:

  1. When you use the Object property to retrieve arrays of structures, the Object property returns the COM wrapper of the system.array object. In your VBScript test or component steps, you can then use the system.array object to access the array members. Buy Property in Portugal

    ReplyDelete

175248765853890