Reputation: 11
I have RichTextBox control with hidden both Scrollbars. When they are hidden I can't scroll text with mouse, I can only use PgUp and PgDown keys to move the text.
But I want to scroll with mouse when ScrollBars are disabled, is there any way I can do this?
Upvotes: 1
Views: 1150
Reputation: 685
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
}
Upvotes: 1