Treeview OCX - Set Focus

Cringer

ProgressTalk.com Moderator
Staff member
In which case you'll need to provide a lot more detail as the answer Wolfgang has given is correct. There is evidently a problem with your code.
 

balta

Member
@Cringer, problem with my code?

I have a Treeview with OCX that i want to the focus.

I have this TreeView.

1688029071727.png

The same is inicialized like this.

Code:
/* TREEVIEW */
    assign chTreeView            = chtv:TreeView.
    assign chImageList           = chim:ImageList.
    assign chTreeView:ImageList  = chImageList.

When i do this don´t work

Code:
chTreeView:focus().

Give this error

1688029238921.png

Also with

Code:
chTreeView:TreeView:focus().
 

Osborne

Active Member
How are you hosting the TreeView OCX, is it in a CONTROL-FRAME which was created something similar to?:

Code:
DEFINE VARIABLE CtrlFrame AS WIDGET-HANDLE NO-UNDO.

CREATE CONTROL-FRAME CtrlFrame
   ASSIGN
       FRAME           = FRAME F1:HANDLE
       ROW             = 1.24
       COLUMN          = 4
       HEIGHT          = 14.29
       WIDTH           = 35
       WIDGET-ID       = 6
       HIDDEN          = no
       SENSITIVE       = yes.

If so, can you set focus to the CONTROL-FRAME instead of the Treeview?:

Code:
APPLY "ENTRY" TO CtrlFrame.
 
Top