FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour XBROWSE bPastBof -> Focus Move to Previous Control
Posts: 336
Joined: Mon Dec 07, 2009 02:49 PM
XBROWSE bPastBof -> Focus Move to Previous Control
Posted: Sat Sep 27, 2025 04:56 PM
Dear All ,

I have XBROWSE control to accept input and before that there a GET control. And when user press up arrow on first row and first column the focus should move to GET control as bPastBof code block should do. I am using first time this code block so seeking the help for the same. Thanks in advance..!!
    @10,10 GET cVar 
    @50,10 XBROWSE oBrw 

        :bPastBof     := { | o, nK | aoGET[ 6 ]:SetFocus() }  // not working this code block.
Thanks

Shridhar

FWH 24.04, BCC 7 32 bit, MariaDB
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: XBROWSE bPastBof -> Focus Move to Previous Control
Posted: Sat Sep 27, 2025 09:29 PM

Dea Shridar,

Please try this:

aoGET[ 6 ]:PostFocus()

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 336
Joined: Mon Dec 07, 2009 02:49 PM
Re: XBROWSE bPastBof -> Focus Move to Previous Control
Posted: Sun Sep 28, 2025 04:51 AM
Dear Antonio ,

Have tried but not working , getting below error

[code]
         :bPastBof     := { | o, nK | aoGET[ 6 ]:PostFocus() }
Application
===========
Path and name: D:\vimcosoft\V9ACC\v9acc.exe (32 bits)
Size: 5,613,568 bytes
Compiler version: Harbour 3.2.0dev (r2405310955)
FiveWin version: FWH 24.04
C compiler version: Borland/Embarcadero C++ 7.7 (32-bit)
Windows 11 64 Bits, version: 6.2, Build 9200

Time from start: 0 hours 0 mins 12 secs
Error occurred at: 28-09-2025, 10:18:28
Error description: Error BASE/1004 Message not found: TGET:POSTFOCUS
Args:
[ 1] = O TGET

Stack Calls
===========
Called from: ../../../tobject.prg => __ERRRT_SBASE( 0 )
Called from: ../../../tobject.prg => TGET:ERROR( 0 )
Called from: ../../../tobject.prg => (b)HBOBJECT( 0 )
Called from: ../../../tobject.prg => TGET:MSGNOTFOUND( 0 )
Called from: ../../../tobject.prg => TGET:POSTFOCUS( 0 )
Called from: D:\vimcosoft\V9ACC\PRGS\aq_txn_sale.prg => (b)TXNSALE( 161 )
Called from: .\source\classes\xbrowse.prg => TXBROWSE:GOUP( 4422 )
Called from: .\source\classes\xbrowse.prg => TXBROWSE:KEYDOWN( 3689 )
Called from: .\source\classes\window.prg => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\control.prg => TCONTROL:HANDLEEVENT( 1877 )



[/code]
Thanks

Shridhar

FWH 24.04, BCC 7 32 bit, MariaDB
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: XBROWSE bPastBof -> Focus Move to Previous Control
Posted: Sun Sep 28, 2025 07:37 AM

Sorry, I meant this:

aoGET[ 6 ]:PostMsg( WM_SETFOCUS )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 336
Joined: Mon Dec 07, 2009 02:49 PM
Re: XBROWSE bPastBof -> Focus Move to Previous Control
Posted: Sun Sep 28, 2025 01:02 PM
Dear Antonio ,

Apologize it was my mistake as the aGET[6] was read only so it was not able to get focus state.

I changed the code as below now it is working fine. Now the keyboard navigation extremely powerful. Thanks a lot for your kind support.
:bPastBof     := < | o, nK |
                              if oBrwInv:nRowSel == 1 .AND. oBrwInv:nColSel == 1
                                  aoGET[ 5 ]:SetFocus() 
                              endif 
                              return nil 
                          >
Thanks

Shridhar

FWH 24.04, BCC 7 32 bit, MariaDB

Continue the discussion