Why xbrowse not getting focus after entering the date?
Solved using WS_TABSTOP in RC file
using CONTROL "Custom control", 4001, "TXBROWSE", WS_TABSTOP
Regards
- Code: Select all Expand view RUN
- #include "fivewin.ch"
#include "dtpicker.ch"
#include "xbrowse.ch"
function Voucher(oWndVchr,oWndMain,oRsVchr,oCn)
local aGrad := { { 0.5, METRO_STEEL, METRO_STEEL }, { 0.5, METRO_STEEL, METRO_STEEL } }
local oBrush,VchDate:=date(),oBrw
local lNew:=.t.
local aVoucher:={{ 0,space(30),0.00," ",space(30)}}
//ledger id,ledger name, amt, credit/debit, narration
LOCAL oDlg
SetDlgGradient( aGrad )
aBlankItem := oRsvchr:BlankRow()
set date format "dd/mm/yyyy"
DEFINE DIALOG oDlg RESOURCE "VCHDIAG" SIZE 400,600 TITLE "VOUCHER"
REDEFINE SAY ID 100 PROMPT "&Date:" of oDlg
REDEFINE GET VchDate ID 110 MESSAGE "Voucher Date" of oDlg UPDATE ;
ACTION (VchDate := Min( MsgDate( VchDate ), Date()), oBrw:SetFocus() )
REDEFINE xbrowse oBrw ID 4001 of oDlg DATASOURCE aVoucher;
COLUMNS 1,2,3,4,5 ;
HEADERS "Id","Ledger","Amount","Type","narration" ;
CELL LINES FOOTERS FASTEDIT UPDATE
oBrw:Id:nEditType := EDIT_GET
oBrw:ledger:nEditType := EDIT_GET
ACTIVATE DIALOG oDlg ON INIT Sttsbar(oDlg) CENTERED
//RELEASE FONT oFont, oLarge
//RELEASE BRUSH oBrush
return nil
STATIC FUNCTION Sttsbar( oDlg )
SET MESSAGE OF oDlg;
TO " ";
TIME NOINSET 2007
RETURN NIL
static function SaveVoucher()
return NIL
static function EditVoucher()
return NIL
static function DeleteVoucher()
return NIL
- Code: Select all Expand view RUN
- // RESOURCE SCRIPT generated by "Pelles C for Windows, version 12.00".
#include <windows.h>
#include <commctrl.h>
#include <richedit.h>
LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US
VCHDIAG DIALOG DISCARDABLE 6, 18, 394, 238
STYLE WS_POPUP|DS_MODALFRAME|WS_CAPTION|WS_SYSMENU
CAPTION "Voucher Dialog"
FONT 8, "MS Sans Serif"
{
CONTROL "Date:", 100, "Static", WS_GROUP, 10, 8, 98, 16
CONTROL "", 110, "SysDateTimePick32", WS_TABSTOP, 8, 20, 60, 14
CONTROL "Custom control", 4001, "TXBROWSE", 0x00000000, 8, 40, 364, 168
}