c# - 滚动到 C# DataGridView 的底部

标签 c# winforms datagridview scrollbar

我试图在 C# WinForm 中滚动到 DataGridView 的底部。

此代码适用于文本框:

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

...但我不知道如何使用 DataGridView 来完成。有什么帮助吗?

最佳答案

要滚动到 DataGridView 的底部,试试这个。

dataGridView1.FirstDisplayedScrollingRowIndex = dataGridView1.RowCount-1;

关于c# - 滚动到 C# DataGridView 的底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9969061/

相关文章:

c# - 如何知道一条线是否与矩形相交

css - 如何在 VB.net 中为 DataGridView 提供通用样式

c# - 令人惊讶的 int.ToString 输出

c# - 控件不在焦点时下拉列表更改所选值

c# - 使用与主程序存储在不同文件夹中的引用库 (dll)?

javascript - 通过单击 WebBrowser Control 中的按钮来调用 C# 函数

c# - 将Datagridview中的数据保存到MySQL

c# - 如何在 DataGridViewComboBox 中显示 Enum 类型的成员?

c# - GitHub 上是否提供适用于 ASP .Net Core 3.1 的 ChangePasswordAsync?

c# - 有 8 位字符的字符串类型吗?