Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MFC
Hi
I am working with CWnd derived class, created with WS_VSCROLL.
Correctly updating the scrollbar positions, ranges... using setscrollInfo. But when we are resizing the container window (dialog) suddenly scrollbar disappears for some window sizes. If i increase further or decrease furhter, again the scrollbar appears.
What can be the best method to stick the scrollbar according to the window size.
Please reply me if you need any additional inputs.
 
Thanks in advance
Best Regards
Raghav
Posted 3-Nov-10 0:39am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

The scrollbars are normally only shown when needed and hidden otherwise. You can use ShowScrollBar to control this.
 
http://msdn.microsoft.com/en-us/library/bb787601%28VS.85%29.aspx[^]
 
Some additional info:
http://msdn.microsoft.com/en-us/library/bb787527%28VS.85%29.aspx#scroll_bar_visibility[^]
 
Good luck!
  Permalink  
Comments
Raghava Hosur at 4-Nov-10 6:14am
   
Hi, Thank you for the reply. I do understand the scrollbar enable/disable functionality. But my situation is at one particular size of window, the scrollbar is disappearing. But if reduce/increase the window size the scrollbar is coming again. What can be the reason. If the scroll bar disappearing, even if I reduce the window size further also it should remain disappear. But surprisingly it is getting enabled. My implementation is to display the scrollbar always, irrespecitve of the min max sizes. Even if the content is of single page, then also I want to display the scrollbar. Please address. Once again Thanks in advance. Best Regards Raghav
polczym at 5-Feb-11 16:56pm
   
I too am encountering a similar behaviour when using the .Net Windows Forms Textbox control. I have both scrollbars enabled, and when I perform a resize, the respective scrollbar disappears. I'm sure our problems are related. Hopefully Microsoft will reply with an answer or fix.
polczym at 5-Feb-11 16:59pm
   
Further Google research uncovered the following article: http://connect.microsoft.com/VisualStudio/feedback/details/304330/scroll-bar-disappears
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

call SetScrollSizes in OnInitialUpdate of the view.
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

I am facing the same issue on Win XP when we put the Win 98 classic style. Any Suggestion ??
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

This is a .NET bug and has been fixed in .NET 4.5
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 sanket saxena 355
1 Abhinav S 303
2 Sergey Alexandrovich Kryukov 299
3 OriginalGriff 225
4 thatraja 220
0 Sergey Alexandrovich Kryukov 8,497
1 OriginalGriff 4,850
2 Peter Leow 3,839
3 Maciej Los 3,535
4 Er. Puneet Goel 3,107


Advertise | Privacy | Mobile
Web03 | 2.8.140415.2 | Last Updated 28 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid