在Visual Basic中以编程方式设置FocusGridView控件 [英] Setting Focus on DataGridView Control programmatically in Visual Basic
问题描述
我想通过编程方式将焦点设置为Visual Basic的DataGridView控件中的最后一行(最下面,仅一列)。我如何才能这样做?
I want to programmatically set the focus to the last row (bottommost, its only one column wide) in the DataGridView control for Visual Basic. How can I do so?
到目前为止,我已尝试过
So far, I have tried
DGV.Rows.GetLastRow(DataGridViewElementStates.Selected)
没有成功,虽然我没想到工作。
without success, though I did not expect that to work.
绝对必须选择最后一个单元格。否则,这个应用程序几乎不可能使用!
It absolutely must select that last cell. Otherwise, the application is nearly impossible to use!
这是一个截图,我正在做的是这样的: http://www.mediafire.com/?mmyogzytgzt
Here is a screenshot of what I am making with this: http://www.mediafire.com/?mmyogzytgzt
粘贴剪贴板内容按钮只有粘贴到选定的单元格中,虽然我想我可以找到一个解决方法。
The "Paste Clipboard Contents" button only pastes into the selected cell, though I guess I could find a workaround.
推荐答案
我解决了。我使用一种解决方法直接添加文本。我不再需要了!
I solved it. I used a workaround to add the text in directly. I don't need this anymore!
这篇关于在Visual Basic中以编程方式设置FocusGridView控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!