[C#] Listbox AutoScroll 하기
반응형
기본적으로 listbox는 아이템이 추가돼도 오토스크롤이 되지 않는다.
아래와 같은 코드를 추가해준다
-ListBox Autoscroll
listBox1.SelectedIndex = listBox1.Items.Count - 1; listBox1.SelectedIndex = -1; |
아래는 다른 개체의 Auto scroll 방법이다.
-TextBox Autoscroll
textBox1.SelectionStart = textBox1.Text.Length; textBox1.ScrollToCaret(); |
-LextView Autoscroll
listView1.EnsureVisible(listView1.Items.Count - 1); |
-TreeView Autoscroll
treeView1.Nodes[treeView1.Nodes.Count - 1].EnsureVisible(); |
-DataGridView Autoscroll
dataGridView1.FirstDisplayedCell = dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[0]; |
반응형
'Programming > C#' 카테고리의 다른 글
C# | FileStream 사용하기 (Write) (0) | 2017.03.02 |
---|---|
[C#] TextBox, ListBox, ListView AutoScroll (0) | 2015.07.31 |
C# 접근 한정자 (0) | 2013.08.10 |
[C#] string -> char[] / char[] -> string 변환하기 (0) | 2013.06.07 |
댓글
이 글 공유하기
다른 글
-
C# | FileStream 사용하기 (Write)
C# | FileStream 사용하기 (Write)
2017.03.02 -
[C#] TextBox, ListBox, ListView AutoScroll
[C#] TextBox, ListBox, ListView AutoScroll
2015.07.31 -
C# 접근 한정자
C# 접근 한정자
2013.08.10 -
[C#] string -> char[] / char[] -> string 변환하기
[C#] string -> char[] / char[] -> string 변환하기
2013.06.07