Skinned listbox |
Post Reply |
Author | |
rdmeyers
Groupie Joined: 11 December 2008 Location: United States Status: Offline Points: 22 |
Post Options
Thanks(0)
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?
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
rdmeyers
Groupie Joined: 11 December 2008 Location: United States Status: Offline Points: 22 |
Post Options
Thanks(0)
|
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?
|
|
TomCollins88
Newbie Joined: 05 February 2009 Location: United States Status: Offline Points: 2 |
Post Options
Thanks(0)
|
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. |
|
rdmeyers
Groupie Joined: 11 December 2008 Location: United States Status: Offline Points: 22 |
Post Options
Thanks(0)
|
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.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |