winform中如何使用方法控制datagridview的自帶滾動條往上或者往下
uj5u.com熱心網友回復:
你參考下 應該非常簡單的 很久不寫winform了以前也用到過 這個場景需求
public void ScrollToRow(int theRow)
{
//
// Expose the protected GridVScrolled method allowing you
// to programmatically scroll the grid to a particular row.
//
if (DataSource != null)
{
GridVScrolled(this, new ScrollEventArgs(ScrollEventType.LargeIncrement, theRow));
}
}
int v= dataGridView1.VerticalScrollingOffset ;
int h= dataGridView1.HorizontalScrollingOffset ;
//...reload
dataGridView1.VerticalScrollingOffset = v;
dataGridView1.HorizontalScrollingOffset =h;
uj5u.com熱心網友回復:
這不錯,注記一下uj5u.com熱心網友回復:
需要的是shift+tab的組合鍵操作,可以寫一下給我看嗎?轉載請註明出處,本文鏈接:https://www.uj5u.com/net/107549.html
標籤:C#
上一篇:winform焦點問題
下一篇:C++代碼轉C#
