I've seen the question asked a couple of times and didn't see an anwser. So in case anyone else needs to solve the problem of flicker when certain actions are taken on a panel such as recreating a canvas. Use the Win32 API function LockWindowUpdate()
;;;;
;.lib "user32.dll"
;LockWindowUpdate(hWnd%) : "LockWindowUpdate"
;;;;
; Locking window to prevent the flicker
LockWindowUpdate(QueryObject(drawPanel, 1))
FreeGadget canvas
canvas = CreateCanvas (0, 0, 200, 200, drawPanel)
SetGadgetLayout canvas,0,0,0,0
LockWindowUpdate(0) ; Make sure to unlock the window
Ken Carlino
www.pixarra.com
;;;;
;.lib "user32.dll"
;LockWindowUpdate(hWnd%) : "LockWindowUpdate"
;;;;
; Locking window to prevent the flicker
LockWindowUpdate(QueryObject(drawPanel, 1))
FreeGadget canvas
canvas = CreateCanvas (0, 0, 200, 200, drawPanel)
SetGadgetLayout canvas,0,0,0,0
LockWindowUpdate(0) ; Make sure to unlock the window
Ken Carlino
www.pixarra.com