![]() |
|
![]() | ||
|
Subject:
Visual C++ / MFC Scrollbars infuriating behavior.
Category: Computers > Programming Asked by: emtavano-ga List Price: $10.00 |
Posted:
06 Jun 2002 13:06 PDT
Expires: 08 Jun 2002 00:37 PDT Question ID: 23348 |
It's been a little while since I've done MFC, so there's probably an obvious step I'm missing in this process, or else I am insane. You be the judge. I am writing a form-based single document application, with a CFormView as the base view class. I have two rich edit controls which I want to scroll using a single scrollbar. In the dialog editor, I dropped what I believe is called the common controls scrollbar (vertical) into the dialog. It's the scrollbar right on the dialog editor toolbar, not an activex control. If you try this and then test the dialog, you will see that when you drag the scroll box, it always snaps back up to the top. I can't seem to change this behavior. I assigned it a member variable and set the range with SetScrollRange. I tried SetScrollPos. I tried SetScrollInfo. The WM_VSCROLL message is being sent correctly, but the nPos parameter in the overridden function is always zero. How do you make this thing act like a scrollbar? How do you make the nPos parameter come back with a value? I need that specific question answered. I don't need any more alternative approaches to the problem, such as splitter windows, using the rich edit control scroll bars, etc. Thank you. | |
|
![]() | ||
|
There is no answer at this time. |
![]() | ||
|
Subject:
Re: Visual C++ / MFC Scrollbars infuriating behavior.
From: adamf-ga on 07 Jun 2002 10:20 PDT |
Check out this sample sourcecode for handling a scrollbar. It explains all the scrollbar behaviour and how to programatically handle the scroll bar controls messages. Some additional info can be found at the comments below the source code: http://www.codeguru.com/controls/scrollbar_handling.shtml If this is not what you needed, let me know what more information you need and I would be happy to provide it for you. AdamF - Researcher Applicant |
Subject:
Re: Visual C++ / MFC Scrollbars infuriating behavior.
From: emtavano-ga on 08 Jun 2002 00:37 PDT |
I had actually seen that page on Codeguru already but couldn't get that example to work either. But as so often happens, when you leave a problem alone for a few days, when you come back the solution is obvious. That IS the answer and good for you for finding it, adamf. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |