列表视在初始化的时候可以排满一行,但是这时我再最大化窗口它就排不满了。
比如:有20个图标,开始窗口处于非最大状态,这时图标排成 5 行 4 列,当我最大化窗口时我想让它变为 4 行 5 列 或者2行 十列,总之我想让它在任何时候尽量排满每一行,我该怎么做呢?
比如:有20个图标,开始窗口处于非最大状态,这时图标排成 5 行 4 列,当我最大化窗口时我想让它变为 4 行 5 列 或者2行 十列,总之我想让它在任何时候尽量排满每一行,我该怎么做呢?
nCodeLVA_ALIGNLEFT Aligns items along the left edge of the window.
LVA_ALIGNTOP Aligns items along the top edge of the window.
LVA_DEFAULT Aligns items according to the list view’s current alignment styles (the default value).LVA_SNAPTOGRID Snaps all icons to the nearest grid position.
void CRecorderView::OnViewRefresh()
{
// TODO: Add your command handler code here
BOOL bSuccess;
CListCtrl& listCtrl=GetListCtrl();
bSuccess=listCtrl.Arrange(LVA_SNAPTOGRID);
UpdateData();
}