TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
chris.rothery
NA
1
0
Using the mousewheel properly
Sep 29 2003 8:42 AM
I'm quite new to c#, but have been programming for years, not much in windows but a bit of MFC not too long ago. I've got into c# and am having trouble handling the mousewheel properly in my application. I've got a cut down version of what I'm trying to do that is a default project (1 form) with the following code in the form constructor: Panel p = new Panel(); p.AutoScroll = true; p.Dock = DockStyle.Fill; RichTextBox b = new RichTextBox(); b.Width = 500; b.Height = 500; b.Text = "click me, scroll me!!!"; p.Controls.Add(b); this.Controls.Add(p); so, when the text box is too big for the panel, the scroll bars appear. thing is, that the mouse wheel doesn't scroll the panel. If I change the text box for a button, the wheel scrolls up & down. if the vertical scrollbar isn't needed, but the horizontal one is, the mousewheel scrolls left & right. when both are visible, I'd expect the mousewheel button to allow 2d scrolling (as that's what I've set it to in my driver). a friend suggested doing this by hand (mouse button event, change the cursor, mouse move events change the scroll position), but that sounds a bit lame. Anyone got any ideas? (in my real program, the control being scrolled is an opengl window using csgl).
Reply
Answers (
1
)
TextBox and cursor problem
VS.NET Property controls