المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Displaying of icons in list control at wrong coordinates



C++ Programming
08-12-2009, 01:50 PM
Hi all,

I have made a ICON style list control. In that list control i am displaying thumbnails of different pictures.

I am just adjusting the coordinates to display its position.


m_List.InsertItem(pos, name, pos);
if(line < 4)
{
pt.x = nGap + line*(THUMBNAIL_WIDTH + nGap);
pt.y = 10 + thumb_wdt*(THUMBNAIL_WIDTH + 10);
m_List.SetItemPosition(pos, pt);
}
else
{
line=0;
thumb_wdt++;

pt.x = nGap + line*(THUMBNAIL_WIDTH + nGap);
pt.y = 10 + thumb_wdt*(THUMBNAIL_WIDTH + 10);
m_List.SetItemPosition(pos, pt);
}
line++;



my problem is it displays 2236 items at correct position but the next item it displays at 0th position. i debugged my application, it is calculating right coordinates x = 40, y = 61500. but diaplays item at x = 40,y=10. but after some items it start displaying remaining items at their right position...

I am not understanding how to resolve this problem...

can anybody help me in this...

thanks in advance