REDEFINE LISTBOX

Post Reply
User avatar
tnhoe
Posts: 83
Joined: Tue Nov 08, 2005 11:09 am
Location: Malaysia
Contact:

REDEFINE LISTBOX

Post by tnhoe »

In RC, I add listbox with vertical/horizontal scrollbar ticked , then :-

REDEFINE LISTBOX ... ;
HEADERS ...
FIELDS ...
SIZES ...
ID 101 OF oFld:aDialogs[1]

the listbox shown all data fine (from dbf/cdx) ,

- horizontal scrollbar : use keyboard move ok, mouse click disabled only when reach last field

- vertical scrollbar : use keyboard move ok, mouse click disabled totally
Regards

Hoe, email: easywin3@yahoo.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Hoe,

This sample works fine:

Code: Select all

#include "FWCE.ch"

REQUEST DBFCDX

function Main()

   local oWnd, oBrw, hBmp := ReadBitmap( CurDir() + "\go.bmp" )

   USE ( CurDir() + "\Customer" ) VIA "DBFCDX"

   DEFINE WINDOW oWnd TITLE "Tutor10"
   
   @ 1, 1 LISTBOX oBrw ;
      FIELDS hBmp, Customer->Last, Customer->First ;
      HEADERS "", "Last", "First" ;
      SIZE 220, 167
   
   @ 12, 2 BUTTON "Dlg" SIZE 80, 30 ;
      ACTION OpenDialog()

   @ 12, 17 BUTTON "Done" SIZE 80, 30 ;
      ACTION oWnd:End()
   
   ACTIVATE WINDOW oWnd ;
      ON CLICK MsgInfo( "Click!" )
   
return nil

function OpenDialog()

   local oDlg, oLbx
   
   DEFINE DIALOG oDlg RESOURCE "Test"
   
   REDEFINE LISTBOX oLbx FIELDS First, Last ID 10 OF oDlg
   
   ACTIVATE DIALOG oDlg CENTERED
   
return nil   

Code: Select all

#include "..\include\winapi.ch"

test DIALOG 6, 15, 150, 119
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Test"
FONT 8, "MS Sans Serif"
{
 CONTROL "", 10, "TWBrowse", 0 | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | WS_BORDER | WS_TABSTOP, 3, 5, 143, 88
 DEFPUSHBUTTON "OK", IDOK, 20, 99, 50, 14
 PUSHBUTTON "Cancel", IDCANCEL, 80, 99, 50, 14
}
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
tnhoe
Posts: 83
Joined: Tue Nov 08, 2005 11:09 am
Location: Malaysia
Contact:

Post by tnhoe »

Sorry, my mistake.

After adding more rows of data, it works fine.
Regards

Hoe, email: easywin3@yahoo.com
Post Reply