Get class and focus

Get class and focus

Postby driessen » Mon Mar 05, 2012 2:11 pm

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. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Get class and focus

Postby hmpaquito » Mon Mar 05, 2012 3:18 pm

Hi,

Code: Select all  Expand view

hFocus:= GetFocus()

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

SetFocus(hFocus)
 


Regards
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Get class and focus

Postby Antonio Linares » Mon Mar 05, 2012 4:25 pm

Michel,

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

...

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42087
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Get class and focus

Postby Demont Brecht » Mon Mar 05, 2012 7:16 pm

Michel

Changing focus seems always to be dificult and unprecditable.

I have much better results with :

Code: Select all  Expand view

*****************************************************************************************
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
 
Demont Brecht
 
Posts: 55
Joined: Fri Jul 08, 2011 6:43 am

Re: Get class and focus

Postby driessen » Mon Mar 05, 2012 7:42 pm

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. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 110 guests