简体   繁体   English

同步面板滚动条和文本框滚动条

[英]synchronizing pannel scrollbar and textbox scrollbar

On a Winform/C# application, I created a panel, on this pannel I added a TextBox . 在Winform / C#应用程序上,我创建了一个面板,在此面板上添加了TextBox

I enable the horizontal pannel scrollbar, and I would like to be able to scroll my textbox using the pannel scrollbar ( and not the textbox scrollbar). 我启用了水平Pannel滚动条,并且希望能够使用Pannel滚动条(而不是文本框滚动条)滚动文本框。

Is this possible ? 这可能吗 ?

For the moment I did this : 目前,我这样做是:

panel1.HorizontalScroll.Enabled = true;
panel1.HorizontalScroll.Visible = true;

My scrollbar pannel is displayed but it doesn't scroll. 我的滚动条面板已显示,但没有滚动。

AS MSDN says: AS MSDN说:

Used to group collections of controls. 用于对控件集合进行分组。

I think you are trying use it as a "decoration", if that is the purpose, try extend textbox control and add that with other "draw" controls. 我认为您正在尝试将其用作“装饰”,如果这是目的,请尝试扩展文本框控件,并将其与其他“绘制”控件一起添加。

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

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