Programming/C#

대화창 자동 스크롤

알렙 2013. 12. 12. 12:02


textBox

textBox1.SelectionStart = textBox1.Text.Length;

textBox1.ScrollToCaret();


c# 4.0 이상 에선


textbox1.ScrollToEnd();


출처: http://alperguc.blogspot.kr/2008/11/c-textbox-auto-scroll-to-end.html



listBox

listBox1.SelectedIndex = listBox1.Items.Count - 1;

listBox1.SelectedIndex = -1;


listView 

listView1.Items[listView1.Items.Count -1].EnsureVisible();


listView1.SelectedItem = listView1.Items.GetItemAt(listViewModel1.Entries.Count - 1);

listView1.ScrollIntoView(listView1.SelectedItem);