Print Page | Close Window

Skinned listbox

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=13085
Printed Date: 23 November 2024 at 4:50am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Skinned listbox
Posted By: rdmeyers
Subject: Skinned listbox
Date Posted: 06 January 2009 at 11:50am
I have a listbox that gets populated with 10,000+ items.  This typically takes only 1 second, but if the application is skinned it takes 8 seconds!  Why should skinning the app effect the performance of seemingly unrelated tasks?



Replies:
Posted By: Oleg
Date Posted: 07 January 2009 at 2:58pm
Hi,
 
Guess ListBox redraw Scrollbar on each change.
 
Just add
 m_wndListBox.SetRedraw(FALSE);
 m_wndListBox.SetRedraw(TRUE);
 
around populating and you will get same 1sec.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: rdmeyers
Date Posted: 07 January 2009 at 3:49pm
I was referring to a standard VB6 listbox control, so your code sample won't work.
 
Neither hiding the Listbox control, nor calling LockWindowUpdate on it improves the poor performance.
 
However, I did find a workaround that appears to solve the problem:
        SkinFramework1.RemoveWindow Listbox1.hWnd
        ' fill listbox code goes here
        SkinFramework1.ApplyWindow Listbox1.hWnd
Do you see any potential problem or side effect with this approach?
 


Posted By: TomCollins88
Date Posted: 08 February 2009 at 9:22am
Have you tried turning off the autoredraw for the form?

me.AutoRedraw = False
'load listbox
me.AutoRedraw = True

Haven't had a chance to try it, but I think it'll work.


Posted By: rdmeyers
Date Posted: 25 June 2019 at 12:33pm
Well it has been 10 years and in an attempt to use the SkinFramework again I have found that this performance problem still exists!  How can I prevent the ListBox control from drawing the scrollbar after each item is added to it?  I have the control's Visible property set to False, and the Form's AutoRedraw property set to False.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net