source from this article http://www.java2s.com/Code/CSharp/GUI-Windows-Form/SetTopIndextoautoscrollListBox.htm
the key code:
eventLogList.Items.Add(data);
int itemsPerPage = (int)(eventLogList.Height / eventLogList.ItemHeight);
eventLogList.TopIndex = eventLogList.Items.Count - itemsPerPage;
the key code:
eventLogList.Items.Add(data);
int itemsPerPage = (int)(eventLogList.Height / eventLogList.ItemHeight);
eventLogList.TopIndex = eventLogList.Items.Count - itemsPerPage;
No comments:
Post a Comment