By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,881 Members | 1,407 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,881 IT Pros & Developers. It's quick & easy.

ListView focus

P: n/a
Dear all,
When adding a row in a listview, I want to do some thing like this:
1. Make sure this new item will be all visible
2. Set the last item as selected item
3. Make it as focus and hightlight as it was selected (by left-click to this
item on the listview)
saple code:
m_ctrlRecordList.EnsureVisible(m_ctrlRecordList.It ems.Count-1);
m_ctrlRecordList.Items[m_ctrlRecordList.Items.Count-1].Focused = true;
m_ctrlRecordList.Items[m_ctrlRecordList.Items.Count-1].Selected = true;
m_ctrlRecordList.Focus();

But it wasn't focused and not highlight as selected.

Thank you alot,
Giang.
Nov 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.