Forum Discussion

suvidhshetty_1's avatar
suvidhshetty_1
Occasional Contributor
13 years ago

SetFocus method does not work on ThunderRT6PictureBoxDC.

Hi,

I was trying SetFocus method on 'ThunderRT6PictureBoxDC', even after doing testObj.SetFocus, the focused propety of the testObj remains false ( the object is visible on the screen). I have tried this on 8.5 version of testcomplete as well as on 8.2 version it didn't work. I have associated TextRecognition property to it so as to recognise it as a text object as list. When I perform 'Call testObj.SetFocus', testObj is the object of 'ThunderRT6PictureBoxDC' class, it doesn't sets the focus on it. I require a method other than clicking to set the focus on the picture object.



Thanks,

Suvidh

1 Reply

  • AlexeyK's avatar
    AlexeyK
    SmartBear Alumni (Retired)

    Suvidh,


    I'm not a big specialist in Visual Basic controls, but, probably, picture boxes cannot be focused as they are non-windowed controls. Can you focus it when working with your application manually?


    If I'm wrong and this control can be focused,  SetFocus should work. Alternatively, you can try setting the focus by simulating the TAB keystroke: 

    *  Move the cursor over the control (for example, a text box) that is before the picture box in the TAB order.

    *  Use the Keys(...) method to simulate the TAB keystroke in this control:

          testboxObj.Keys("[Tab]")

    The focus should jump to your control.