C#でスクロールバーにマウススクロールホイール制御イベントを追加


 

public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.richTextBox1.MouseWheel += new System.Windows.Forms.MouseEventHandler(richTextBox1_MouseWheel);
}

void richTextBox1_MouseWheel(object sender, MouseEventArgs e)
{
this.Location = new System.Drawing.Point(this.Location.X, this.Location.Y + e.Delta);
}
}

, , :

new System.Drawing.Point(this.Location.X + e.Delta, this.Location.Y);