Get class and focus

Post Reply
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Get class and focus

Post by driessen »

Hello,

A small question ?

How can I read which GET has the clause ?
I want to do make a jump to another screen but I need to restore the focus on the right GET.

Thanks in advance.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
hmpaquito
Posts: 1200
Joined: Thu Oct 30, 2008 2:37 pm

Re: Get class and focus

Post by hmpaquito »

Hi,

Code: Select all

hFocus:= GetFocus()

.....  // blah, blah, blah...

SetFocus(hFocus)
 
Regards
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Get class and focus

Post by Antonio Linares »

Michel,

nAt = AScan( oDlg:aControls, { | o | o:hWnd == GetFocus() } )

...

oDlg:aControls[ nAt ]:SetFocus()
regards, saludos

Antonio Linares
www.fivetechsoft.com
Demont Brecht
Posts: 55
Joined: Fri Jul 08, 2011 6:43 am

Re: Get class and focus

Post by Demont Brecht »

Michel

Changing focus seems always to be dificult and unprecditable.

I have much better results with :

Code: Select all

*****************************************************************************************
function xSetFocus( oObx )
**************************
// function from local.fivewin.english 4/1/2003 Kleyber Derick
local oTempo:=""
local lGet := oObx:ClassName $ "TGET TMULTIGET"
define timer oTempo interval 10 of oObx:oWnd ;
  action (oObx:SetFocus(), IIF(lGet , oObx:SetPos(0) , ), oTempo:Deactivate() )
activate timer oTempo

return nil
 
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Get class and focus

Post by driessen »

Hello guys,

Thanks a lot for all you help.

I'll be trying out your suggestions.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
Post Reply