user971580
user971580

Reputation:

C# Sync vertical scrollbars on two textboxes with different line lengths (VS2010, .Net Framework 4)

I'm using the following code snippet as a proof of concept to sync scrollbars of two adjacent textboxed, but am getting rather odd 'StackOverFlow' exceptions.

Upvotes: 1

Views: 290

Answers (1)

Peter
Peter

Reputation: 1625

On my mobile, so can not test your code right now, and don't really follow it, but the StackOverflowException makes me guess that when one of your scrollbars moves, the other is moved by code, triggering an event to move the first one again, triggering an event to move the second one again, and so on until the stack overflows...

Upvotes: 1

Related Questions