Inserting the 2nd line into a listbox cause a double repaint of the line
- also in FWH . How can I to avoid this behavior.
Thanks in advance
Otto
Inserting the 2nd line into a listbox cause a double repaint of the line
- also in FWH . How can I to avoid this behavior.
Thanks in advance
Otto
Disturbing is that the listbox is opened without a scrollbar and after you insert the 2nd line the scrollbar is added.
On the PPC this makes an unstable impression to the user.
Best regards,
Otto
Otto,
Could you please provide a small and self contained PRG to reproduce it ? thanks
// FiveWin for Pocket PC - Testing browses with incremental search
#include "FWCE.ch"
REQUEST DBFCDX
//----------------------------------------------------------------------------//
function Main()
local oWnd, oBrw, hBmp := ReadBitmap( CurDir() + "\go.bmp" )
local oSay, cSearch := ""
USE ( CurDir() + "\Customer" ) VIA "DBFCDX"
if ! File( CurDir() + "\LAST.CDX" )
INDEX ON Customer->Last TO ( CurDir() + "\LAST" )
endif
Customer->( OrdSetFocus( "LAST" ) )
Customer->( DbGoTop() )
DEFINE WINDOW oWnd TITLE "IncSearch"
@ 1, 1 LISTBOX oBrw ;
FIELDS hBmp, Customer->Last, Customer->First ;
HEADERS "", "Last", "First" ;
SIZE 220, 167
@ 12, 17 BUTTON "Add" SIZE 80, 30 ;
ACTION (addRec(),oBrw:gobottom(),oBrw:Refresh())
ACTIVATE WINDOW oWnd ;
ON CLICK MsgInfo( "Click!" )
return nil
//----------------------------------------------------------------------------//
function addRec
append blank
Customer->Last := "test"
Customer->First := "test"
return nil
//----------------------------------------------------------------------------//Otto,
If you want the scrollbar to be shown since the beginning maybe you could have a dummy record added, like "items" or "please select" so you never have only one record.
Its a workaround for it, as a scrollbar does not allow to manage only one item. It has no sense. It is a Windows listbox control (with WS_VSCROLL style) limitation.
Hello Antonio,
Thank you for your answer.
But this workaround does not work well.
If I add only one record the flickering is there with the first I insert with the program.
If I start with 2 dummies on a pocket PC the screen is half full only with the dummies or does the new handy you are working on has such a big screen?
Best regards,
Otto
Otto,
Don't use WS_VSCROLL in the listbox. Paint the up and down as bitmaps, beside the listbox, and use them to oListBox:Select() the previous or next item (oListBox:GetSel()) ![]()