Segue algumas formas de Autoscroll [rolagem automática]:

[sections] [section title=”TextBox Autoscroll”] TextBox Autoscroll

textBox1.SelectionStart = textBox1.Text.Length;
textBox1.ScrollToCaret();

[/section] [section title=”ListBox Autoscroll”] ListBox Autoscroll

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

[/section] [section title=”ListView Autoscroll”] ListView Autoscroll

listView1.EnsureVisible(listView1.Items.Count – 1);

[/section] [section title=”TreeView Autoscroll”] TreeView Autoscroll

treeView1.Nodes[treeView1.Nodes.Count – 1].EnsureVisible();

[/section] [section title=”DataGridView Autoscroll”] DataGridView Autoscroll

dataGridView1.FirstDisplayedCell = dataGridView1.Rows[dataGridView1.Rows.Count – 1].Cells[0];

[/section] [/sections]
Obrigado e até o próximo post.

DATEK Tecnologia Eletrônica
[C#] Autoscroll (TextBox, ListBox, ListView)
Tags:                 

Deixe uma resposta

%d blogueiros gostam disto: