在用listctrl控制項時,當向該控制項中新增資料時,怎麼樣可以把滾動條時時滾動到最後一行,這樣便可看到新增的新資料內容
1
加完資料後執行
ensurevisible(最後一行索引)
可以保證滾動到最後
// the pointer to my list view control.
2: extern clistctrl* pmylistctrl;
3:// ensure that the last item is visible.
4:int ncount = pmylistctrl->getitemcount();
5:if(ncount > 0)
6: pmylistctrl->ensurevisible(ncount-1, false);
2: m_listctrl.setfocus();
3://設定最後一行被選中
4: m_listctrl.setitemstate(m_listctrllog.getitemcount() - 1, lvis_activating | lvis_focused | lvis_selected, lvis_selected | lvis_focused);
5://滾動到最後一行
6: m_listctrl.scroll(csize(0, 100000));
LinearLayout 垂直滾動條
xmlns android android layout width fill parent android layout height fill parent android scrollbars vertical android fadingedge vertical android layou...
LinearLayout 垂直滾動條
xmlns android android layout width fill parent android layout height fill parent android scrollbars vertical android fadingedge vertical android layou...
vb 垂直滾動條定位
sub treefill3 ctime as string,byval ckey as string tree3.nodes.clear 迴圈填充tree1控制項內容 dim c as string dim cnode as node dim csql as string dim crec as r...