简体   繁体   English

滚动问题-用户控件中的Datagridview,已将用户控件实例添加到Flowlayoutpanel

[英]Scroll issue - Datagridview in Usercontrol, Usercontrol instances added to Flowlayoutpanel

I have a situation where I am adding multiple User controls (each containintg datagridview control, buttons and radio buttons) in my flow layout Panel (.net 3.5 Winforms). 我遇到的情况是,我在流布局面板(.net 3.5 Winforms)中添加了多个用户控件(每个containsintg datagridview控件,按钮和单选按钮)。 The height of flow layout panel is lesser than grid. 流布局面板的高度小于网格。

The problem is when I scroll down the the Flowlayout panel vertical scroll and select a cell in the grid the focus moves up at random to a cell, selecting all cells between those two positions. 问题是当我向下滚动Flowlayout面板垂直滚动条并在网格中选择一个单元格时,焦点会随机随机向上移动到一个单元格,从而选择这两个位置之间的所有单元格。

Suggestions please ? 有什么建议吗?

Thanks! 谢谢!

I think you must be having the same problem as explained in the following URLs: 我认为您必须遇到以下网址中所述的相同问题:

Why does clicking in a text box cause an AutoScroll panel to scroll back to the top? 为什么单击文本框会导致“自动滚动”面板回滚到顶部?

http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/445af1e5-0f8d-4e4e-ba97-bc6dc72b5c74/ http://social.msdn.microsoft.com/Forums/zh-CN/winforms/thread/445af1e5-0f8d-4e4e-ba97-bc6dc72b5c74/

If so, overriding ScrollToControl as explained in the above URLs can help fix the issue. 如果是这样,按照上述URL中的说明覆盖ScrollToControl可以帮助解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM