12 years ago
SftTreeControl32OCX - Can't Click on Cells or Items
I am trying to work with a SftTreeControl32OCX in a window in my company's custom applications. It simply stores a list of about 188 items/cells that can be clicked on added/deleted from an adjacent SftTreeControl32OCX (which is defaulted to have 0 items/cells).
When I object spy the SftTreeControl32OCX (with the 188 items/cells), I can see a ListCount of 188. In the window (which is fixed and cannot be resized) that the SftTreeControl32OCX resides, only the first 9 items/cells are visible onscreen (the rest are viewable by using the scroll bar). The ChildCount of the SftTreeControl32OCX shows a count of 9, linking it to the number of viewable items/cells on screen (identified as TextObjects).
I have no problem clicking the TextObjects using the TextObject("").Click method. However, I cannot use this same approach for any of the off screen items/cells. I can use the List(0,0) method to return the text of any item/cell (on or offscreen) but this only returns the text. I need to return the actual item/cell itself, so that I can use the .Click method on it.
When I object spy the SftTreeControl32OCX (with the 188 items/cells), I can see a ListCount of 188. In the window (which is fixed and cannot be resized) that the SftTreeControl32OCX resides, only the first 9 items/cells are visible onscreen (the rest are viewable by using the scroll bar). The ChildCount of the SftTreeControl32OCX shows a count of 9, linking it to the number of viewable items/cells on screen (identified as TextObjects).
I have no problem clicking the TextObjects using the TextObject("").Click method. However, I cannot use this same approach for any of the off screen items/cells. I can use the List(0,0) method to return the text of any item/cell (on or offscreen) but this only returns the text. I need to return the actual item/cell itself, so that I can use the .Click method on it.