【问题标题】:c# RichTextBox - scrolling with hidden ScrollBarc# RichTextBox - 使用隐藏的 ScrollBar 滚动
【发布时间】:2012-08-11 13:39:10
【问题描述】:

我有一个隐藏两个滚动条的 RichTextBox 控件。当它们被隐藏时,我不能用鼠标滚动文本,我只能使用 PgUp 和 PgDown 键来移动文本。

但是当滚动条被禁用时我想用鼠标滚动,有什么办法可以做到吗?

【问题讨论】:

标签: c# scrollbar richtextbox


【解决方案1】:
public Form1()
{
    InitializeComponent();
    richTextBox1.MouseWheel += new MouseEventHandler(richTextBox_MouseWheel);

}

private void Form1_Load(object sender, EventArgs e)
{


}
void richTextBox_MouseWheel(object sender, MouseEventArgs e)
{
         MessageBox.Show(e.Delta.ToString());
         // use this value to scroll

        }

【讨论】:

    猜你喜欢
    • 2010-12-09
    • 2022-01-14
    • 1970-01-01
    • 2018-05-04
    • 1970-01-01
    • 2013-12-17
    • 2015-07-07
    • 1970-01-01
    • 2013-10-14
    相关资源
    最近更新 更多