下面的代码确定的是绝对位置,缓缓拉动滚动条有时候会在某绝对位置出现没有拉动滚动条前某一动态创建的lable的值。请问怎么解决?
label->Width = listView->Columns->Items[SubItem]->Width;
label->Height = Rect.Height() - 2;
int totWidth = 0;
for (int i = 0; i < SubItem; i++)
{
totWidth += listView->Columns->Items[i]->Width;
}
label->Left = Rect.Left + totWidth + (listView->Columns->Items[SubItem]->Width - label->Width)/2;
label->Top = Rect.top + 1;